Move GUI build to separate workflow to avoid cargo-dist conflict #1
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
| # Build the Tauri GUI app (.dmg for macOS) and attach to the GitHub Release. | |
| # Triggered by the same version tags as the TUI release workflow. | |
| name: Release GUI | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: | |
| - '**[0-9]+.[0-9]+.[0-9]+*' | |
| jobs: | |
| build-gui: | |
| runs-on: macos-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-action/setup@v1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install frontend dependencies | |
| working-directory: crates/trailcache-gui | |
| run: npm ci | |
| - name: Import signing certificate | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security default-keychain -s build.keychain | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | |
| rm certificate.p12 | |
| - name: Build Tauri app | |
| working-directory: crates/trailcache-gui | |
| env: | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: npm run tauri build | |
| - name: Upload .dmg to GitHub Release | |
| run: | | |
| # Wait briefly for the TUI release workflow to create the GitHub Release | |
| for i in 1 2 3 4 5; do | |
| if gh release view "${{ github.ref_name }}" > /dev/null 2>&1; then | |
| break | |
| fi | |
| echo "Waiting for release to be created... (attempt $i)" | |
| sleep 30 | |
| done | |
| DMG=$(find crates/trailcache-gui/src-tauri/target/release/bundle/dmg -name "*.dmg" | head -1) | |
| if [ -n "$DMG" ]; then | |
| gh release upload "${{ github.ref_name }}" "$DMG" --clobber | |
| else | |
| echo "No .dmg found, skipping upload" | |
| exit 1 | |
| fi |