mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-19 19:14:53 +00:00
fix: onnxruntime build error when latest release has no artifacts
This commit is contained in:
parent
9c6bfe110a
commit
96717d193f
1 changed files with 16 additions and 1 deletions
|
@ -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<NUM_RELEASES; IDX++ )); do
|
||||
ASSETS_LEN=$(echo "$ONNX_RELEASES" | jq -r ".[$IDX].assets_url" | xargs -n 1 curl -sSL | jq -r '[ select (.[]!=null) ] | length')
|
||||
if [[ $ASSETS_LEN -gt 0 ]]; then
|
||||
ONNX_VER=$(echo "$ONNX_RELEASES" | jq -r ".[$IDX].tag_name" | tr -d v)
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $ONNX_VER ]]; then
|
||||
echo "Failed to find a suitable ONNX Runtime release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYS_ARCH=$(uname -m)
|
||||
|
||||
if [[ $SYS_ARCH == x*64 ]]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue