Skip to content

Commit f56fbe1

Browse files
committed
fix(ci): CI 移除本地 cargo config,ort/sherpa 回退在线下载
1 parent ef18596 commit f56fbe1

2 files changed

Lines changed: 18 additions & 27 deletions

File tree

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,15 @@ jobs:
9090
- name: Prepare models placeholder
9191
shell: bash
9292
run: mkdir -p app/src-tauri/models
93+
# .cargo/config.toml 注入的是本机 Windows 预编译库绝对路径(sherpa-archive/、ort/),
94+
# ort-sys/sherpa-onnx-sys 只要见到 ORT_LIB_LOCATION/SHERPA_ONNX_ARCHIVE_DIR 存在即跳过下载——
95+
# CI 无法 unset env,直接移除 config 使注入消失,两库回退在线下载(CI 网络可达)
96+
- name: Remove local cargo config (CI online download)
97+
shell: bash
98+
run: rm -f app/src-tauri/.cargo/config.toml
9399
- name: Test
94-
# 覆盖 .cargo/config.toml 的本地 Windows 预编译库路径:CI runner 无 D:/ 本机目录,
95-
# 清空后 sherpa-onnx-sys/ort-sys 回退在线下载(CI 网络可达)
96-
env:
97-
SHERPA_ONNX_ARCHIVE_DIR: ""
98-
ORT_LIB_LOCATION: ""
99-
ORT_SKIP_DOWNLOAD: "0"
100-
ORT_PREFER_DYNAMIC_LINK: "1"
101100
run: cd app/src-tauri && cargo test
102101
- name: Lint (clippy)
103-
env:
104-
SHERPA_ONNX_ARCHIVE_DIR: ""
105-
ORT_LIB_LOCATION: ""
106-
ORT_SKIP_DOWNLOAD: "0"
107-
ORT_PREFER_DYNAMIC_LINK: "1"
108102
run: cd app/src-tauri && cargo clippy -- -D warnings
109103

110104
# ===========================================================================

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ jobs:
3737
- name: Prepare models placeholder
3838
shell: bash
3939
run: mkdir -p app/src-tauri/models
40+
# .cargo/config.toml 注入的是本机 Windows 预编译库绝对路径(sherpa-archive/、ort/),
41+
# ort-sys/sherpa-onnx-sys 只要见到 ORT_LIB_LOCATION/SHERPA_ONNX_ARCHIVE_DIR 存在即跳过下载——
42+
# CI 无法 unset env,直接移除 config 使注入消失,两库回退在线下载(CI 网络可达)
43+
- name: Remove local cargo config (CI online download)
44+
shell: bash
45+
run: rm -f app/src-tauri/.cargo/config.toml
4046
- name: Test
41-
# 覆盖 .cargo/config.toml 的本地 Windows 预编译库路径:CI runner 无 D:/ 本机目录,
42-
# 清空后 sherpa-onnx-sys/ort-sys 回退在线下载(CI 网络可达)
43-
env:
44-
SHERPA_ONNX_ARCHIVE_DIR: ""
45-
ORT_LIB_LOCATION: ""
46-
ORT_SKIP_DOWNLOAD: "0"
47-
ORT_PREFER_DYNAMIC_LINK: "1"
4847
run: cd app/src-tauri && cargo test
4948

5049
build:
@@ -75,14 +74,12 @@ jobs:
7574
run: cd app && npm ci
7675
- name: Build Tauri app (NSIS)
7776
shell: bash
78-
# 覆盖 .cargo/config.toml 的本地 Windows 预编译库路径([target.x86_64-pc-windows-msvc.env]):
79-
# CI runner 无 D:/ 本机目录,清空后 sherpa-onnx-sys/ort-sys 回退在线下载(CI 网络可达)
80-
env:
81-
SHERPA_ONNX_ARCHIVE_DIR: ""
82-
ORT_LIB_LOCATION: ""
83-
ORT_SKIP_DOWNLOAD: "0"
84-
ORT_PREFER_DYNAMIC_LINK: "1"
85-
run: cd app && npx tauri build --bundles nsis
77+
# .cargo/config.toml 注入的是本机 Windows 预编译库绝对路径(sherpa-archive/、ort/),
78+
# ort-sys/sherpa-onnx-sys 只要见到 ORT_LIB_LOCATION/SHERPA_ONNX_ARCHIVE_DIR 存在即跳过下载——
79+
# CI 无法 unset env,直接移除 config 使注入消失,两库回退在线下载(CI 网络可达)
80+
run: |
81+
rm -f app/src-tauri/.cargo/config.toml
82+
cd app && npx tauri build --bundles nsis
8683
- uses: actions/upload-artifact@v4
8784
with:
8885
name: release-windows-latest

0 commit comments

Comments
 (0)