修复所有平台的构建错误

macOS:
- 添加 x86_64-apple-darwin target 到 Rust 安装步骤

Linux:
- 将 libwebkit2gtk-4.0-dev 更新为 libwebkit2gtk-4.1-dev(新版本)

Android:
- 修正 Tauri Android 构建命令的 target 参数
- 使用简化的架构名称(aarch64, armv7, x86_64)

Windows:
- 修复 devtools 相关的编译错误
- 将 devtools 调用限制在 debug_assertions 模式下
- 在 release 模式下不调用 devtools 方法(这些方法在 release 中不可用)
This commit is contained in:
Fox_block
2026-03-21 17:51:39 +08:00
parent 50e2ad5077
commit 266510d8be
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -74,6 +74,8 @@ jobs:
- name: 安装 Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: 应用版本号
run: node scripts/ci/apply-version.mjs ${{ needs.parse.outputs.version }}
@@ -106,6 +108,8 @@ jobs:
- name: 安装 Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
- name: 应用版本号
run: node scripts/ci/apply-version.mjs ${{ needs.parse.outputs.version }}
@@ -142,7 +146,7 @@ jobs:
- name: 安装系统依赖
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: 应用版本号
run: node scripts/ci/apply-version.mjs ${{ needs.parse.outputs.version }}
@@ -196,13 +200,13 @@ jobs:
run: pnpm install --frozen-lockfile
- name: 构建 AndroidARM64
run: pnpm tauri android build --target aarch64-linux-android
run: pnpm tauri android build --target aarch64
- name: 构建 AndroidARMv7
run: pnpm tauri android build --target armv7-linux-androideabi
run: pnpm tauri android build --target armv7
- name: 构建 Androidx86_64
run: pnpm tauri android build --target x86_64-linux-android
run: pnpm tauri android build --target x86_64
- uses: actions/upload-artifact@v4
with:
+1 -1
View File
@@ -100,7 +100,7 @@ pub async fn toggle_devtools(
let _ = app;
}
#[cfg(desktop)]
#[cfg(debug_assertions)]
if let Some(window) = app.get_webview_window("main") {
if window.is_devtools_open() {
window.close_devtools();