ci: use matrix to test build #9
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 Alpha | |
| on: | |
| push: | |
| branches: ["master"] | |
| paths: | |
| - "**" | |
| - "!README*" | |
| - "!*.md" | |
| - "!changelog.txt" | |
| - "!docs/**" | |
| - "!.gitignore" | |
| workflow_dispatch: | |
| jobs: | |
| update-alpha-tag: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Update alpha tag | |
| uses: richardsimko/update-tag@v1 | |
| with: | |
| tag_name: alpha | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-and-release: | |
| needs: update-alpha-tag | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: "macos-latest" | |
| args: "--target aarch64-apple-darwin" | |
| target: "aarch64-apple-darwin" | |
| - platform: "macos-latest" | |
| args: "--target x86_64-apple-darwin" | |
| target: "x86_64-apple-darwin" | |
| - platform: "windows-latest" | |
| args: "--target x86_64-pc-windows-msvc" | |
| target: "x86_64-pc-windows-msvc" | |
| - platform: "ubuntu-latest" | |
| args: "--target x86_64-unknown-linux-gnu" | |
| target: "x86_64-unknown-linux-gnu" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies (macOS only) | |
| if: matrix.platform == 'macos-latest' | |
| run: | | |
| # Install system dependencies for Tauri | |
| # No additional dependencies needed for macOS | |
| - name: Install dependencies (Windows only) | |
| if: matrix.platform == 'windows-latest' | |
| run: | | |
| # Install WebView2 offline installer for Windows | |
| # Chocolatey and other dependencies are pre-installed on windows-latest | |
| - name: Install dependencies (Linux only) | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Rust setup | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install Rust target | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './tauri-app/src-tauri -> target' | |
| key: ${{ matrix.target }} | |
| cache-targets: true | |
| cache-all-crates: true | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Sync node version and setup cache | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'pnpm' | |
| cache-dependency-path: './tauri-app/pnpm-lock.yaml' | |
| - name: Install frontend dependencies | |
| working-directory: ./tauri-app | |
| run: pnpm install | |
| - name: Build the app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| projectPath: ./tauri-app | |
| tagName: alpha | |
| releaseName: "Alpha Release" | |
| releaseBody: "Alpha release built from master branch" | |
| releaseDraft: false | |
| prerelease: true | |
| args: ${{ matrix.args }} |