2.4.0 #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS Universal (both aarch64 + x86_64 in one binary) | |
| - platform: macos-latest | |
| target: universal-apple-darwin | |
| label: macOS-universal | |
| # Windows x86_64 | |
| - platform: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| label: Windows-x86_64 | |
| # Linux x86_64 | |
| - platform: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| label: Linux-x86_64 | |
| # Linux ARM64 | |
| - platform: ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| label: Linux-aarch64 | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target == 'universal-apple-darwin' && 'aarch64-apple-darwin,x86_64-apple-darwin' || matrix.target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri | |
| - name: Install Linux dependencies | |
| if: contains(matrix.platform, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libappindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| libgtk-3-dev \ | |
| libsoup-3.0-dev \ | |
| libjavascriptcoregtk-4.1-dev \ | |
| xdg-utils | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: "繁化姬 ${{ github.ref_name }}" | |
| releaseBody: "See the assets below to download and install." | |
| releaseDraft: false | |
| prerelease: false | |
| args: --target ${{ matrix.target }} | |
| includeUpdaterJson: true | |
| - name: Create Windows portable ZIP | |
| if: contains(matrix.platform, 'windows') | |
| shell: pwsh | |
| run: | | |
| $relDir = "src-tauri/target/${{ matrix.target }}/release" | |
| Write-Host "Looking for exe in: $relDir" | |
| Get-ChildItem -Path $relDir -Filter "*.exe" | ForEach-Object { Write-Host " Found: $($_.Name)" } | |
| $exe = Get-ChildItem -Path $relDir -Filter "Fanhuaji.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| if (-not $exe) { | |
| $exe = Get-ChildItem -Path $relDir -Filter "fanhuaji-tauri.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| } | |
| if ($exe) { | |
| Write-Host "Packaging: $($exe.FullName)" | |
| $version = "${{ github.ref_name }}" | |
| $zipName = "Fanhuaji-${version}-windows-portable.zip" | |
| Compress-Archive -Path $exe.FullName -DestinationPath $zipName | |
| gh release upload ${{ github.ref_name }} $zipName --clobber | |
| Write-Host "Uploaded: $zipName" | |
| } else { | |
| Write-Host "WARNING: No portable exe found, skipping" | |
| } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |