| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- name: Build macOS x64
- on:
- workflow_dispatch: # 手动触发,用于单独调试
- workflow_call: # 被其他工作流调用
- jobs:
- build:
- runs-on: macos-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '20'
- cache: 'npm'
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@stable
- with:
- targets: x86_64-apple-darwin
- - name: Cache Rust
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: src-tauri -> target
- cache-targets: true
- shared-key: x86_64-apple-darwin
- - name: Install dependencies
- run: npm ci
- - name: Build application
- env:
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
- run: |
- chmod +x build-mac.sh
- if [ -f ".keys/tauri-signing.key" ]; then
- export TAURI_SIGNING_PRIVATE_KEY=$(cat .keys/tauri-signing.key)
- fi
- node scripts/build.js --target x86_64-apple-darwin
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: artifacts-mac-x64
- path: built/*
- if-no-files-found: error
|