Add Windows build to GUI release workflow, bump to v0.3.6 #8
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 for macOS (.dmg) and Windows (.msi) | |
| # 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-macos: | |
| runs-on: macos-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - 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: | | |
| KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain-db | |
| echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security import certificate.p12 -k $KEYCHAIN_PATH -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security -A | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security list-keychains -d user -s $KEYCHAIN_PATH | |
| security default-keychain -s $KEYCHAIN_PATH | |
| security find-identity -v -p codesigning $KEYCHAIN_PATH | |
| 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 }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" $RUNNER_TEMP/build.keychain-db | |
| npm run tauri build | |
| - name: Upload .dmg to GitHub Release | |
| run: | | |
| # Wait for the TUI release workflow to create the GitHub Release | |
| for i in 1 2 3 4 5 6 7 8 9 10; 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 | |
| # Create the release ourselves if the TUI workflow hasn't yet | |
| if ! gh release view "${{ github.ref_name }}" > /dev/null 2>&1; then | |
| echo "Creating release ${{ github.ref_name }}" | |
| gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --generate-notes | |
| fi | |
| DMG=$(find target/release/bundle/dmg -name "*.dmg" 2>/dev/null | head -1) | |
| if [ -n "$DMG" ]; then | |
| gh release upload "${{ github.ref_name }}" "$DMG" --clobber | |
| else | |
| echo "No .dmg found, skipping upload" | |
| exit 1 | |
| fi | |
| build-windows: | |
| runs-on: windows-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - 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: Build Tauri app | |
| working-directory: crates/trailcache-gui | |
| run: npm run tauri build | |
| - name: Upload installers to GitHub Release | |
| shell: bash | |
| run: | | |
| # Wait for the release to exist | |
| for i in 1 2 3 4 5 6 7 8 9 10; 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 | |
| # Create the release ourselves if it doesn't exist yet | |
| if ! gh release view "${{ github.ref_name }}" > /dev/null 2>&1; then | |
| echo "Creating release ${{ github.ref_name }}" | |
| gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --generate-notes | |
| fi | |
| # Upload .msi | |
| MSI=$(find target/release/bundle/msi -name "*.msi" 2>/dev/null | head -1) | |
| if [ -n "$MSI" ]; then | |
| gh release upload "${{ github.ref_name }}" "$MSI" --clobber | |
| fi | |
| # Upload .exe (NSIS installer) | |
| EXE=$(find target/release/bundle/nsis -name "*.exe" 2>/dev/null | head -1) | |
| if [ -n "$EXE" ]; then | |
| gh release upload "${{ github.ref_name }}" "$EXE" --clobber | |
| fi | |
| if [ -z "$MSI" ] && [ -z "$EXE" ]; then | |
| echo "No .msi or .exe found" | |
| exit 1 | |
| fi |