Skip to content

Commit c99abf4

Browse files
committed
ci: macOS 改为 universal 双架构构建,规避 Intel runner 长时间排队
1 parent 99b15d2 commit c99abf4

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

‎.github/workflows/desktop-build.yml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
- os: windows-latest
2020
label: windows-x64
2121
- os: macos-latest
22-
label: macos-arm64
23-
- os: macos-13
24-
label: macos-x64
22+
label: macos-universal
2523
runs-on: ${{ matrix.os }}
2624
defaults:
2725
run:
@@ -34,8 +32,10 @@ jobs:
3432
with:
3533
node-version: 22
3634

37-
- name: 安装 Rust
35+
- name: 安装 Rust(macOS 附带 universal 双架构 target)
3836
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: x86_64-apple-darwin,aarch64-apple-darwin
3939

4040
- name: Rust 缓存
4141
uses: swatinem/rust-cache@v2
@@ -48,8 +48,13 @@ jobs:
4848
- name: 安装前端依赖
4949
run: npm install --no-fund --no-audit
5050

51-
- name: 构建(Windows 出 NSIS/MSI,macOS 出 App/Dmg)
52-
run: npm run tauri build
51+
- name: 构建(Windows 出 NSIS/MSI,macOS 出 universal App/Dmg)
52+
run: |
53+
if [ "$RUNNER_OS" = "macOS" ]; then
54+
npm run tauri build -- --target universal-apple-darwin
55+
else
56+
npm run tauri build
57+
fi
5358
5459
- name: 上传安装包
5560
uses: actions/upload-artifact@v4
@@ -59,5 +64,6 @@ jobs:
5964
desktop/src-tauri/target/release/bundle/**/*.exe
6065
desktop/src-tauri/target/release/bundle/**/*.msi
6166
desktop/src-tauri/target/release/bundle/**/*.dmg
62-
desktop/src-tauri/target/release/bundle/**/*.app.tar.gz
67+
desktop/src-tauri/target/universal-apple-darwin/release/bundle/**/*.dmg
68+
desktop/src-tauri/target/universal-apple-darwin/release/bundle/**/*.app.tar.gz
6369
if-no-files-found: error

0 commit comments

Comments
 (0)