|
|
@@ -1,90 +1,28 @@
|
|
|
name: Release
|
|
|
|
|
|
on:
|
|
|
+ workflow_dispatch: # 手动触发,用于集成测试
|
|
|
push:
|
|
|
tags:
|
|
|
- 'v*'
|
|
|
|
|
|
jobs:
|
|
|
- # 第一步:并行构建所有平台
|
|
|
- build:
|
|
|
- strategy:
|
|
|
- fail-fast: false
|
|
|
- matrix:
|
|
|
- include:
|
|
|
- - os: windows-latest
|
|
|
- platform: win
|
|
|
- target: x86_64-pc-windows-msvc
|
|
|
- - os: macos-latest
|
|
|
- platform: mac
|
|
|
- target: aarch64-apple-darwin
|
|
|
- - os: macos-latest
|
|
|
- platform: mac-intel
|
|
|
- target: x86_64-apple-darwin
|
|
|
- - os: ubuntu-22.04
|
|
|
- platform: linux
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
+ # 调用各平台构建工作流
|
|
|
+ build-windows:
|
|
|
+ uses: ./.github/workflows/build-windows.yml
|
|
|
+ secrets: inherit
|
|
|
|
|
|
- runs-on: ${{ matrix.os }}
|
|
|
+ build-macos:
|
|
|
+ uses: ./.github/workflows/build-macos.yml
|
|
|
+ secrets: inherit
|
|
|
|
|
|
- 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: ${{ matrix.target }}
|
|
|
-
|
|
|
- - name: Cache Rust
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
- with:
|
|
|
- workspaces: src-tauri -> target
|
|
|
- cache-targets: true
|
|
|
- shared-key: ${{ matrix.target }}
|
|
|
-
|
|
|
- - name: Install Linux dependencies (cached)
|
|
|
- if: matrix.platform == 'linux'
|
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
|
- with:
|
|
|
- packages: libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libgtk-3-dev
|
|
|
- version: 1.0
|
|
|
-
|
|
|
- - name: Install dependencies
|
|
|
- run: npm ci
|
|
|
-
|
|
|
- - name: Build application (Windows)
|
|
|
- if: matrix.platform == 'win'
|
|
|
- env:
|
|
|
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
|
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
|
|
|
- run: node scripts/build.js --target ${{ matrix.target }}
|
|
|
-
|
|
|
- - name: Build application (macOS/Linux)
|
|
|
- if: matrix.platform != 'win'
|
|
|
- env:
|
|
|
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
|
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
|
|
|
- run: |
|
|
|
- chmod +x build-mac.sh build-linux.sh
|
|
|
- node scripts/build.js --target ${{ matrix.target }}
|
|
|
-
|
|
|
- - name: Upload artifacts
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
- with:
|
|
|
- name: artifacts-${{ matrix.platform }}
|
|
|
- path: built/*
|
|
|
- if-no-files-found: error
|
|
|
+ build-linux:
|
|
|
+ uses: ./.github/workflows/build-linux.yml
|
|
|
+ secrets: inherit
|
|
|
|
|
|
- # 第二步:创建 Release 并上传所有产物
|
|
|
+ # 所有构建完成后创建 Release
|
|
|
release:
|
|
|
- needs: build
|
|
|
+ needs: [build-windows, build-macos, build-linux]
|
|
|
runs-on: ubuntu-latest
|
|
|
permissions:
|
|
|
contents: write
|
|
|
@@ -117,6 +55,7 @@ jobs:
|
|
|
|
|
|
### Linux
|
|
|
- `*-linux-x64.deb` - Debian/Ubuntu
|
|
|
+ - `*-linux-x64.rpm` - Fedora/RHEL/CentOS
|
|
|
- `*-linux-x64.AppImage` - 通用 AppImage
|
|
|
draft: false
|
|
|
prerelease: false
|