|
| 1 | +name: Test Release Builds |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + CARGO_TERM_COLOR: always |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - os: ubuntu-latest |
| 16 | + target: x86_64-unknown-linux-gnu |
| 17 | + artifact: linux |
| 18 | + - os: windows-latest |
| 19 | + target: x86_64-pc-windows-msvc |
| 20 | + artifact: windows |
| 21 | + - os: macos-latest |
| 22 | + target: aarch64-apple-darwin |
| 23 | + artifact: macos-arm |
| 24 | + - os: macos-13 |
| 25 | + target: x86_64-apple-darwin |
| 26 | + artifact: macos-intel |
| 27 | + |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Install Linux deps |
| 33 | + if: matrix.os == 'ubuntu-latest' |
| 34 | + uses: ./.github/actions/install-linux-deps |
| 35 | + with: |
| 36 | + verify_glib: 'false' |
| 37 | + |
| 38 | + - uses: dtolnay/rust-toolchain@stable |
| 39 | + with: |
| 40 | + targets: ${{ matrix.target }} |
| 41 | + env: |
| 42 | + PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig |
| 43 | + |
| 44 | + - uses: Swatinem/rust-cache@v2 |
| 45 | + with: |
| 46 | + key: ${{ matrix.target }}-test-release |
| 47 | + env: |
| 48 | + PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig |
| 49 | + |
| 50 | + - uses: pnpm/action-setup@v4 |
| 51 | + - uses: actions/setup-node@v4 |
| 52 | + with: |
| 53 | + node-version: 20 |
| 54 | + cache: 'pnpm' |
| 55 | + |
| 56 | + - run: pnpm install --frozen-lockfile |
| 57 | + |
| 58 | + - name: Import Apple certificate |
| 59 | + if: runner.os == 'macOS' |
| 60 | + id: apple-cert |
| 61 | + env: |
| 62 | + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} |
| 63 | + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
| 64 | + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} |
| 65 | + run: | |
| 66 | + if [ -z "$APPLE_CERTIFICATE" ] || [ -z "$KEYCHAIN_PASSWORD" ]; then |
| 67 | + echo "No Apple certificate configured — using ad-hoc signing" |
| 68 | + echo "identity=-" >> "$GITHUB_OUTPUT" |
| 69 | + exit 0 |
| 70 | + fi |
| 71 | + echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 |
| 72 | + if [ ! -s certificate.p12 ]; then |
| 73 | + echo "Certificate decode produced empty file — using ad-hoc signing" |
| 74 | + rm -f certificate.p12 |
| 75 | + echo "identity=-" >> "$GITHUB_OUTPUT" |
| 76 | + exit 0 |
| 77 | + fi |
| 78 | + security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain |
| 79 | + security default-keychain -s build.keychain |
| 80 | + security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain |
| 81 | + if ! security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign; then |
| 82 | + echo "Certificate import failed — using ad-hoc signing" |
| 83 | + rm -f certificate.p12 |
| 84 | + echo "identity=-" >> "$GITHUB_OUTPUT" |
| 85 | + exit 0 |
| 86 | + fi |
| 87 | + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain |
| 88 | + rm certificate.p12 |
| 89 | + echo "identity=${{ secrets.APPLE_SIGNING_IDENTITY }}" >> "$GITHUB_OUTPUT" |
| 90 | +
|
| 91 | + # Same as release but without releaseId (no upload to GitHub release) |
| 92 | + - name: Build Tauri app |
| 93 | + uses: tauri-apps/tauri-action@v0 |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 96 | + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 97 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 98 | + PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig |
| 99 | + APPLE_SIGNING_IDENTITY: ${{ steps.apple-cert.outputs.identity }} |
| 100 | + with: |
| 101 | + projectPath: apps/desktop |
| 102 | + args: --target ${{ matrix.target }} |
| 103 | + |
| 104 | + - name: List build artifacts |
| 105 | + shell: bash |
| 106 | + run: | |
| 107 | + echo "=== Target: ${{ matrix.target }} ===" |
| 108 | + echo "=== Runner arch: $(uname -m) ===" |
| 109 | + echo "" |
| 110 | + echo "=== Bundle output ===" |
| 111 | + find target/${{ matrix.target }}/release/bundle -type f 2>/dev/null | head -30 || echo "No bundle directory found" |
| 112 | +
|
| 113 | + - name: Upload artifacts |
| 114 | + uses: actions/upload-artifact@v4 |
| 115 | + with: |
| 116 | + name: build-${{ matrix.artifact }} |
| 117 | + path: | |
| 118 | + target/${{ matrix.target }}/release/bundle/dmg/*.dmg |
| 119 | + target/${{ matrix.target }}/release/bundle/deb/*.deb |
| 120 | + target/${{ matrix.target }}/release/bundle/rpm/*.rpm |
| 121 | + target/${{ matrix.target }}/release/bundle/appimage/*.AppImage |
| 122 | + target/${{ matrix.target }}/release/bundle/nsis/*.exe |
| 123 | + target/${{ matrix.target }}/release/bundle/msi/*.msi |
| 124 | + if-no-files-found: warn |
0 commit comments