fix: update artifact preparation and upload steps in build workflow #11
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 and Release Tauri App | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-tauri: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: 'macos-latest' # Mac Intel x86_64 | |
| target: 'x86_64-apple-darwin' | |
| args: '--target x86_64-apple-darwin' | |
| - platform: 'macos-14' # Mac ARM (M1/M2) | |
| target: 'aarch64-apple-darwin' | |
| args: '--target aarch64-apple-darwin' | |
| - platform: 'ubuntu-24.04' # Linux x86_64 | |
| target: 'x86_64-unknown-linux-gnu' | |
| args: '--target x86_64-unknown-linux-gnu' | |
| - platform: 'windows-latest' # Windows x86_64 | |
| target: 'x86_64-pc-windows-msvc' | |
| args: '' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies (Linux only) | |
| if: matrix.platform == 'ubuntu-24.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/* | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust dependencies | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| args: ${{ matrix.args }} | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts-${{ matrix.target }} | |
| path: | | |
| src-tauri/target/${{ matrix.target }}/release/bundle/**/*.msi | |
| src-tauri/target/${{ matrix.target }}/release/bundle/**/*.dmg | |
| src-tauri/target/${{ matrix.target }}/release/bundle/**/*.deb | |
| src-tauri/target/${{ matrix.target }}/release/bundle/**/*.AppImage | |
| src-tauri/target/release/bundle/**/*.msi | |
| src-tauri/target/release/bundle/**/*.dmg | |
| src-tauri/target/release/bundle/**/*.deb | |
| src-tauri/target/release/bundle/**/*.AppImage | |
| if-no-files-found: error | |
| release: | |
| needs: build-tauri | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Create Draft Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v0.1.0 | |
| name: Release v0.1.0 | |
| body: | | |
| Automated release for Nginx WAF Desktop Client v0.1.0. | |
| ## Changes | |
| - Cross-platform builds for Linux x86_64, Windows x86_64, Mac Intel, Mac ARM. | |
| ## Downloads | |
| Download the installer files (.msi for Windows, .dmg for Mac, .deb/.AppImage for Linux) for your platform from the assets below. | |
| draft: true | |
| files: ./artifacts/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |