From 96717d193f5e39a829161fc1f2d6c13393eea186 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sat, 1 Mar 2025 17:10:49 -0600 Subject: [PATCH] fix: onnxruntime build error when latest release has no artifacts --- scripts/build_mercury.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/build_mercury.sh b/scripts/build_mercury.sh index fffd979..b3db66a 100755 --- a/scripts/build_mercury.sh +++ b/scripts/build_mercury.sh @@ -11,7 +11,22 @@ if [[ -z $PREFIX ]] || [[ -z $CACHE_DIR ]]; then exit 1 fi -ONNX_VER=$(curl -sSL "https://api.github.com/repos/microsoft/onnxruntime/releases/latest" | jq -r .tag_name | tr -d v) +ONNX_RELEASES=$(curl -sSL "https://api.github.com/repos/microsoft/onnxruntime/releases") +NUM_RELEASES=$(echo "$ONNX_RELEASES" | jq -r '[ select (.[]!=null) ] | length') + +for (( IDX=0; IDX