|
| 1 | +name: Build Tauri App |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, dev] |
| 6 | + tags: ["v*"] |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - platform: ubuntu-22.04 |
| 20 | + target: linux |
| 21 | + - platform: macos-latest |
| 22 | + target: macos |
| 23 | + - platform: windows-latest |
| 24 | + target: windows |
| 25 | + |
| 26 | + runs-on: ${{ matrix.platform }} |
| 27 | + timeout-minutes: 30 |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Install Rust stable |
| 34 | + uses: dtolnay/rust-toolchain@stable |
| 35 | + |
| 36 | + - name: Rust cache |
| 37 | + uses: swatinem/rust-cache@v2 |
| 38 | + with: |
| 39 | + workspaces: src-tauri -> target |
| 40 | + |
| 41 | + - name: Install Linux dependencies |
| 42 | + if: matrix.target == 'linux' |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y \ |
| 46 | + libwebkit2gtk-4.1-dev \ |
| 47 | + libappindicator3-dev \ |
| 48 | + librsvg2-dev \ |
| 49 | + patchelf |
| 50 | +
|
| 51 | + - name: Setup Node |
| 52 | + uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: 22 |
| 55 | + cache: npm |
| 56 | + |
| 57 | + - name: Install frontend dependencies |
| 58 | + run: npm ci |
| 59 | + |
| 60 | + - name: Build Tauri app |
| 61 | + uses: tauri-apps/tauri-action@v0 |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + tagName: ${{ github.ref_type == 'tag' && github.ref_name || '' }} |
| 66 | + releaseName: ${{ github.ref_type == 'tag' && format('CardputerZero AppBuilder {0}', github.ref_name) || '' }} |
| 67 | + releaseBody: "See the assets below to download and install." |
| 68 | + releaseDraft: ${{ github.ref_type == 'tag' }} |
| 69 | + prerelease: false |
| 70 | + |
| 71 | + - name: Upload artifacts |
| 72 | + if: github.ref_type != 'tag' |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: cardputerzero-appbuilder-${{ matrix.target }} |
| 76 | + path: | |
| 77 | + src-tauri/target/release/bundle/deb/*.deb |
| 78 | + src-tauri/target/release/bundle/appimage/*.AppImage |
| 79 | + src-tauri/target/release/bundle/dmg/*.dmg |
| 80 | + src-tauri/target/release/bundle/macos/*.app |
| 81 | + src-tauri/target/release/bundle/msi/*.msi |
| 82 | + src-tauri/target/release/bundle/nsis/*.exe |
| 83 | + retention-days: 30 |
0 commit comments