name: Build and Release on: push: branches: - main tags: - 'v*' pull_request: branches: - main workflow_dispatch: env: CARGO_TERM_COLOR: always jobs: build: strategy: fail-fast: false matrix: platform: - os: ubuntu-latest target: x86_64-unknown-linux-gnu name: linux-amd64 - os: windows-latest target: x86_64-pc-windows-msvc name: windows-amd64 - os: macos-latest target: x86_64-apple-darwin name: macos-amd64 - os: macos-latest target: aarch64-apple-darwin name: macos-arm64 runs-on: ${{ matrix.platform.os }} steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} - name: Install Linux dependencies if: matrix.platform.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - name: Rust cache uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' - name: Build frontend run: npm run build - name: Build Tauri app uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tauriScript: npm run tauri - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: ${{ matrix.platform.name }} path: | src-tauri/target/${{ matrix.platform.target }}/release/bundle/ !src-tauri/target/${{ matrix.platform.target }}/release/bundle/**/*.dSYM/ if-no-files-found: error release: needs: build runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout repository uses: actions/checkout@v4 - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Create Release uses: softprops/action-gh-release@v1 with: files: | artifacts/windows-amd64/**/*.exe artifacts/windows-amd64/**/*.msi artifacts/linux-amd64/**/*.AppImage artifacts/linux-amd64/**/*.deb artifacts/macos-amd64/**/*.dmg artifacts/macos-arm64/**/*.dmg draft: false prerelease: false generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}