|
| 1 | +name: Tauri Linux Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - develop |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: tauri-linux-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-linux: |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Read version from package.json |
| 22 | + id: version |
| 23 | + run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT |
| 24 | + |
| 25 | + - name: Install Linux system dependencies |
| 26 | + run: | |
| 27 | + sudo apt-get update |
| 28 | + sudo apt-get install -y \ |
| 29 | + libwebkit2gtk-4.1-dev \ |
| 30 | + libssl-dev \ |
| 31 | + libayatana-appindicator3-dev \ |
| 32 | + librsvg2-dev \ |
| 33 | + libxdo-dev \ |
| 34 | + libunrar-dev \ |
| 35 | + build-essential \ |
| 36 | + curl \ |
| 37 | + wget \ |
| 38 | + file \ |
| 39 | + patchelf |
| 40 | +
|
| 41 | + - name: Install Rust stable |
| 42 | + uses: dtolnay/rust-toolchain@stable |
| 43 | + |
| 44 | + - name: Cache Rust build artifacts |
| 45 | + uses: Swatinem/rust-cache@v2 |
| 46 | + with: |
| 47 | + workspaces: src-tauri |
| 48 | + |
| 49 | + - name: Setup pnpm |
| 50 | + uses: pnpm/action-setup@v4 |
| 51 | + |
| 52 | + - name: Setup Node |
| 53 | + uses: actions/setup-node@v4 |
| 54 | + with: |
| 55 | + node-version: lts/* |
| 56 | + cache: pnpm |
| 57 | + |
| 58 | + - name: Install frontend dependencies |
| 59 | + # --ignore-scripts skips the postinstall openapi-generator-cli |
| 60 | + # which fetches a remote URL — src/api/ is already committed |
| 61 | + run: pnpm install --frozen-lockfile --ignore-scripts |
| 62 | + |
| 63 | + - name: Patch tauri.conf.json version |
| 64 | + run: | |
| 65 | + VERSION=${{ steps.version.outputs.VERSION }} |
| 66 | + sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" src-tauri/tauri.conf.json |
| 67 | +
|
| 68 | + - name: Build Tauri app (Linux) |
| 69 | + run: cargo tauri build |
| 70 | + env: |
| 71 | + TAURI_SIGNING_PRIVATE_KEY: "" |
| 72 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "" |
| 73 | + |
| 74 | + - name: Rename artifacts |
| 75 | + run: | |
| 76 | + VERSION=${{ steps.version.outputs.VERSION }} |
| 77 | + mv src-tauri/target/release/bundle/appimage/*.AppImage \ |
| 78 | + gamevault-frontend_${VERSION}_linux_x64.AppImage |
| 79 | + mv src-tauri/target/release/bundle/deb/*.deb \ |
| 80 | + gamevault-frontend_${VERSION}_linux_x64.deb |
| 81 | +
|
| 82 | + # ── master: upload to versioned release ────────────────────────────────── |
| 83 | + |
| 84 | + - name: Upload AppImage to release (master) |
| 85 | + if: github.ref == 'refs/heads/master' |
| 86 | + uses: svenstaro/upload-release-action@v2 |
| 87 | + with: |
| 88 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + file: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.AppImage |
| 90 | + asset_name: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.AppImage |
| 91 | + tag: ${{ steps.version.outputs.VERSION }} |
| 92 | + overwrite: true |
| 93 | + |
| 94 | + - name: Upload .deb to release (master) |
| 95 | + if: github.ref == 'refs/heads/master' |
| 96 | + uses: svenstaro/upload-release-action@v2 |
| 97 | + with: |
| 98 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + file: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.deb |
| 100 | + asset_name: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.deb |
| 101 | + tag: ${{ steps.version.outputs.VERSION }} |
| 102 | + overwrite: true |
| 103 | + |
| 104 | + # ── develop: upload to unstable pre-release ─────────────────────────────── |
| 105 | + |
| 106 | + - name: Upload AppImage to unstable release (develop) |
| 107 | + if: github.ref == 'refs/heads/develop' |
| 108 | + uses: svenstaro/upload-release-action@v2 |
| 109 | + with: |
| 110 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + file: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.AppImage |
| 112 | + asset_name: gamevault-frontend_linux_x64.AppImage |
| 113 | + tag: unstable |
| 114 | + overwrite: true |
| 115 | + prerelease: true |
| 116 | + |
| 117 | + - name: Upload .deb to unstable release (develop) |
| 118 | + if: github.ref == 'refs/heads/develop' |
| 119 | + uses: svenstaro/upload-release-action@v2 |
| 120 | + with: |
| 121 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 122 | + file: gamevault-frontend_${{ steps.version.outputs.VERSION }}_linux_x64.deb |
| 123 | + asset_name: gamevault-frontend_linux_x64.deb |
| 124 | + tag: unstable |
| 125 | + overwrite: true |
| 126 | + prerelease: true |
0 commit comments