|
43 | 43 | - name: Remove local cargo config (CI online download) |
44 | 44 | shell: bash |
45 | 45 | run: rm -f app/src-tauri/.cargo/config.toml |
| 46 | + # oar-ocr 未启用 ort-sys 的 download-binaries feature(本地靠 ORT_LIB_LOCATION 链接), |
| 47 | + # CI 必须手动提供 ONNX Runtime 库,与本地 ORT_LIB_LOCATION 同机制(CPU 包即可,测试不初始化 CUDA) |
| 48 | + - name: Prepare ONNX Runtime for CI |
| 49 | + shell: bash |
| 50 | + run: | |
| 51 | + mkdir -p app/src-tauri/ort/ci |
| 52 | + curl -sL https://github.com/microsoft/onnxruntime/releases/download/v1.28.0/onnxruntime-win-x64-1.28.0.zip -o /tmp/ort.zip |
| 53 | + unzip -q /tmp/ort.zip -d /tmp/ortx |
| 54 | + cp /tmp/ortx/onnxruntime-win-x64-1.28.0/lib/onnxruntime.* app/src-tauri/ort/ci/ |
46 | 55 | - name: Test |
| 56 | + # ORT_PREFER_DYNAMIC_LINK=1:与本地一致走动态链接,规避 static MT 与项目 MD 运行时的 LNK2038 冲突 |
| 57 | + env: |
| 58 | + ORT_LIB_LOCATION: ort/ci |
| 59 | + ORT_PREFER_DYNAMIC_LINK: "1" |
47 | 60 | run: cd app/src-tauri && cargo test |
48 | 61 |
|
49 | 62 | build: |
|
79 | 92 | # CI 无法 unset env,直接移除 config 使注入消失,两库回退在线下载(CI 网络可达) |
80 | 93 | run: | |
81 | 94 | rm -f app/src-tauri/.cargo/config.toml |
| 95 | + mkdir -p app/src-tauri/ort/ci |
| 96 | + curl -sL https://github.com/microsoft/onnxruntime/releases/download/v1.28.0/onnxruntime-win-x64-1.28.0.zip -o /tmp/ort.zip |
| 97 | + unzip -q /tmp/ort.zip -d /tmp/ortx |
| 98 | + cp /tmp/ortx/onnxruntime-win-x64-1.28.0/lib/onnxruntime.* app/src-tauri/ort/ci/ |
82 | 99 | cd app && npx tauri build --bundles nsis |
| 100 | + # oar-ocr 未启用 ort-sys download-binaries(本地靠 ORT_LIB_LOCATION 链接), |
| 101 | + # CI 手动提供 ORT 库并复用同一机制;动态链接规避 LNK2038(同本地 config) |
| 102 | + env: |
| 103 | + ORT_LIB_LOCATION: ort/ci |
| 104 | + ORT_PREFER_DYNAMIC_LINK: "1" |
83 | 105 | - uses: actions/upload-artifact@v4 |
84 | 106 | with: |
85 | 107 | name: release-windows-latest |
|
0 commit comments