#!/usr/bin/env bash # Fetch prebuilt ONNX Runtime (linux-x64 for headless validation, win-x64 for # the shipped build). The official microsoft/onnxruntime GitHub repo was removed # on 2026-11-17; these are the unchanged 1.20.1 assets from a recovery mirror. set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" V="${ORT_VERSION:-1.20.1}" B="https://github.com/cga-management/third-party-mirror/releases/download/onnxruntime-${V}" mkdir -p "${HERE}/third_party" cd "${HERE}/third_party" if [ ! -d onnxruntime-linux-x64 ]; then curl -fsSL -o ort-linux.tgz "${B}/onnxruntime-linux-x64-${V}.tgz" tar xzf ort-linux.tgz && rm ort-linux.tgz mv "onnxruntime-linux-x64-${V}" onnxruntime-linux-x64 fi if [ ! -d onnxruntime-win-x64 ]; then curl -fsSL -o ort-win.zip "${B}/onnxruntime-win-x64-${V}.zip" python3 -c "import zipfile; zipfile.ZipFile('ort-win.zip').extractall('.')" rm ort-win.zip && mv "onnxruntime-win-x64-${V}" onnxruntime-win-x64 fi echo "ONNX Runtime ${V} ready: $(ls -d onnxruntime-*-x64)"