Build #2
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
| name: Build | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows-latest | |
| rust-targets: x86_64-pc-windows-msvc | |
| tauri-args: "" | |
| artifact-name: game-library-windows | |
| artifact-path: | | |
| src-tauri/target/release/bundle/msi/*.msi | |
| src-tauri/target/release/bundle/nsis/*.exe | |
| - platform: ubuntu-latest | |
| rust-targets: x86_64-unknown-linux-gnu | |
| tauri-args: "" | |
| artifact-name: game-library-linux | |
| artifact-path: | | |
| src-tauri/target/release/bundle/deb/*.deb | |
| src-tauri/target/release/bundle/rpm/*.rpm | |
| src-tauri/target/release/bundle/appimage/*.AppImage | |
| - platform: macos-latest | |
| rust-targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| tauri-args: "--target universal-apple-darwin" | |
| artifact-name: game-library-mac | |
| artifact-path: | | |
| src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg | |
| src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt update | |
| sudo apt install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| pkg-config \ | |
| build-essential | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Enable Corepack and install Yarn | |
| run: | | |
| corepack enable | |
| yarn --version | |
| - name: Install frontend dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust-targets }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri | |
| - name: Build Tauri app | |
| run: yarn tauri build ${{ matrix.tauri-args }} | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact-name }} | |
| path: ${{ matrix.artifact-path }} | |
| if-no-files-found: error | |
| retention-days: 30 |