Skip to content

Commit 0d60094

Browse files
committed
fix(ci): sherpa 库改用 SHERPA_ONNX_ARCHIVE_DIR 预置机制(绕开不稳定内嵌下载)
1 parent bc2ff9b commit 0d60094

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

‎.github/workflows/pr-check.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,21 @@ jobs:
105105
curl -sL https://github.com/microsoft/onnxruntime/releases/download/v1.28.0/onnxruntime-win-x64-1.28.0.zip -o /tmp/ort.zip
106106
unzip -q /tmp/ort.zip -d /tmp/ortx
107107
cp /tmp/ortx/onnxruntime-win-x64-1.28.0/lib/onnxruntime.* app/src-tauri/ort/ci/
108+
# sherpa-onnx-sys 自带的在线下载在 CI 上不稳定(曾出现解压残缺导致 LNK1181),
109+
# 改用官方 SHERPA_ONNX_ARCHIVE_DIR 机制(与本地 config 一致):curl 预下载 tar 包
110+
- name: Prepare sherpa-onnx archive for CI
111+
shell: bash
112+
run: |
113+
mkdir -p app/src-tauri/sherpa-archive
114+
curl -sL "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.5/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2" \
115+
-o app/src-tauri/sherpa-archive/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2
108116
- name: Test
109117
# ORT_PREFER_DYNAMIC_LINK=1:与本地一致走动态链接,规避 static MT 与项目 MD 运行时的 LNK2038 冲突
110118
shell: bash
111119
env:
112120
ORT_LIB_LOCATION: ${{ github.workspace }}/app/src-tauri/ort/ci
113121
ORT_PREFER_DYNAMIC_LINK: "1"
122+
SHERPA_ONNX_ARCHIVE_DIR: ${{ github.workspace }}/app/src-tauri/sherpa-archive
114123
# 跳过 3 个预存基线失败(CHANGELOG 已登记,与本版无关):
115124
# ai_client 默认 Provider 断言 / note_filter 两条黄金用例——待后续版本修复
116125
run: |

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,22 @@ jobs:
5454
curl -sL https://github.com/microsoft/onnxruntime/releases/download/v1.28.0/onnxruntime-win-x64-1.28.0.zip -o /tmp/ort.zip
5555
unzip -q /tmp/ort.zip -d /tmp/ortx
5656
cp /tmp/ortx/onnxruntime-win-x64-1.28.0/lib/onnxruntime.* app/src-tauri/ort/ci/
57+
# sherpa-onnx-sys 自带的在线下载在 CI 上不稳定(曾出现解压残缺导致 LNK1181),
58+
# 改用官方 SHERPA_ONNX_ARCHIVE_DIR 机制(与本地 config 一致):curl 预下载 tar 包,
59+
# build script 从 archive 解压,绕开其内嵌下载逻辑
60+
- name: Prepare sherpa-onnx archive for CI
61+
shell: bash
62+
run: |
63+
mkdir -p app/src-tauri/sherpa-archive
64+
curl -sL "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.5/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2" \
65+
-o app/src-tauri/sherpa-archive/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2
5766
- name: Test
5867
# ORT_PREFER_DYNAMIC_LINK=1:与本地一致走动态链接,规避 static MT 与项目 MD 运行时的 LNK2038 冲突
5968
shell: bash
6069
env:
6170
ORT_LIB_LOCATION: ${{ github.workspace }}/app/src-tauri/ort/ci
6271
ORT_PREFER_DYNAMIC_LINK: "1"
72+
SHERPA_ONNX_ARCHIVE_DIR: ${{ github.workspace }}/app/src-tauri/sherpa-archive
6373
# 跳过 3 个预存基线失败(CHANGELOG 已登记,与本版无关):
6474
# ai_client 默认 Provider 断言 / note_filter 两条黄金用例——待后续版本修复
6575
run: |
@@ -96,14 +106,22 @@ jobs:
96106
run: mkdir -p app/src-tauri/models
97107
- name: Install frontend deps
98108
run: cd app && npm ci
109+
# sherpa-onnx-sys 自带的在线下载在 CI 上不稳定(曾出现解压残缺导致 LNK1181),
110+
# 改用官方 SHERPA_ONNX_ARCHIVE_DIR 机制(与本地 config 一致):curl 预下载 tar 包
111+
- name: Prepare sherpa-onnx archive for CI
112+
shell: bash
113+
run: |
114+
mkdir -p app/src-tauri/sherpa-archive
115+
curl -sL "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.5/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2" \
116+
-o app/src-tauri/sherpa-archive/sherpa-onnx-v1.13.5-win-x64-shared-MT-Release-lib.tar.bz2
99117
- name: Build Tauri app (NSIS)
100118
shell: bash
101119
# .cargo/config.toml 注入的是本机 Windows 预编译库绝对路径(sherpa-archive/、ort/),
102120
# ort-sys/sherpa-onnx-sys 只要见到 ORT_LIB_LOCATION/SHERPA_ONNX_ARCHIVE_DIR 存在即跳过下载——
103-
# CI 无法 unset env,直接移除 config 使注入消失,两库回退在线下载(CI 网络可达)
121+
# CI 无法 unset env,直接移除 config 使注入消失,改由下方 env 显式注入 CI 预下载路径
104122
run: |
105123
rm -f app/src-tauri/.cargo/config.toml
106-
# rust-cache 恢复的 target/sherpa-onnx-prebuilt 可能不完整(历史 LNK1181),强制重新下载
124+
# rust-cache 恢复的 target/sherpa-onnx-prebuilt 可能不完整(历史 LNK1181),强制重新解压
107125
rm -rf app/src-tauri/target/sherpa-onnx-prebuilt
108126
mkdir -p app/src-tauri/ort/ci
109127
curl -sL https://github.com/microsoft/onnxruntime/releases/download/v1.28.0/onnxruntime-win-x64-1.28.0.zip -o /tmp/ort.zip
@@ -115,6 +133,7 @@ jobs:
115133
env:
116134
ORT_LIB_LOCATION: ${{ github.workspace }}/app/src-tauri/ort/ci
117135
ORT_PREFER_DYNAMIC_LINK: "1"
136+
SHERPA_ONNX_ARCHIVE_DIR: ${{ github.workspace }}/app/src-tauri/sherpa-archive
118137

119138
# ---------------------------------------------------------------
120139
# 发布阶段(不再走 artifact 中转:配额 500MB 装不下 349MB 安装包多次构建)

0 commit comments

Comments
 (0)