diff --git a/.github/actions/download-onnxruntime-macos.sh b/.github/actions/download-onnxruntime-macos.sh new file mode 100755 index 0000000..42680ef --- /dev/null +++ b/.github/actions/download-onnxruntime-macos.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" || exit + +echo +echo "Select onnxruntime version to download:" +RAW_LIST=$(curl -s -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/microsoft/onnxruntime/releases/latest \ + | grep browser_download_url \ + | grep "onnxruntime-osx-universal" \ + | awk '{print $2}' \ + | tr -d '"') + +item=${RAW_LIST[0]} + +FILENAME=$(basename "$item") + +echo +echo "Downloading $item" +echo + +wget -q "$item" + +sudo mkdir -p /usr/local/onnxruntime +sudo tar vzxf "$FILENAME" -C /usr/local/onnxruntime --strip-components=1 + +rm -f "$FILENAME" + +echo +echo "Done" +echo diff --git a/.github/workflows/cmake-macos.yml b/.github/workflows/cmake-macos.yml index 8a52638..e6a78dc 100644 --- a/.github/workflows/cmake-macos.yml +++ b/.github/workflows/cmake-macos.yml @@ -31,7 +31,8 @@ jobs: shell: bash run: | brew update - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake onnxruntime boost openssl googletest + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake boost openssl googletest curl + ./.github/actions/download-onnxruntime-macos.sh - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.