fix: cross-platform support for shell PATH resolution and build pipeline #7
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: 'Tauri Build' | |
| on: | |
| pull_request: | |
| paths: | |
| - 'apps/desktop/**' | |
| - 'src/**' | |
| - 'package.json' | |
| - 'next.config.ts' | |
| - 'scripts/build-static.mjs' | |
| - 'scripts/prepare-frontend.mjs' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/desktop/**' | |
| - 'src/**' | |
| - 'package.json' | |
| - 'next.config.ts' | |
| - 'scripts/build-static.mjs' | |
| - 'scripts/prepare-frontend.mjs' | |
| workflow_dispatch: | |
| jobs: | |
| build-tauri: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: 'macos-latest' | |
| args: '--target aarch64-apple-darwin' | |
| arch: 'arm64' | |
| - platform: 'macos-latest' | |
| args: '--target x86_64-apple-darwin' | |
| arch: 'x64' | |
| - platform: 'ubuntu-22.04' | |
| args: '' | |
| arch: 'x64' | |
| - platform: 'windows-latest' | |
| args: '' | |
| arch: 'x64' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies (Ubuntu only) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './apps/desktop/src-tauri -> target' | |
| - name: Install root dependencies | |
| run: npm ci | |
| - name: Install desktop dependencies | |
| working-directory: apps/desktop | |
| run: npm ci | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| projectPath: apps/desktop | |
| args: ${{ matrix.args }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tauri-build-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| apps/desktop/src-tauri/target/release/bundle/**/*.dmg | |
| apps/desktop/src-tauri/target/release/bundle/**/*.app | |
| apps/desktop/src-tauri/target/release/bundle/**/*.deb | |
| apps/desktop/src-tauri/target/release/bundle/**/*.AppImage | |
| apps/desktop/src-tauri/target/release/bundle/**/*.msi | |
| apps/desktop/src-tauri/target/release/bundle/**/*.exe | |
| retention-days: 7 |