build: add multi-arch builds, auto-release notes, and DMG config #14
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: Tip (Nightly) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - args: '--target aarch64-apple-darwin' | |
| arch: 'silicon' | |
| - args: '--target x86_64-apple-darwin' | |
| arch: 'intel' | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build frontend | |
| run: npm run build | |
| - name: Build Tauri app (${{ matrix.arch }}) | |
| run: npm run tauri:build -- ${{ matrix.args }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dmg-${{ matrix.arch }} | |
| path: src-tauri/target/*/release/bundle/dmg/*.dmg | |
| release: | |
| needs: build-macos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Update tip release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: tip | |
| name: 'Snipp Tip ("Nightly")' | |
| prerelease: true | |
| body: | | |
| This tip release is automatically built on every commit to main. | |
| **Warning: This is a nightly build, not a tagged release.** | |
| Built from commit: ${{ github.sha }} | |
| **Apple Silicon** (M1+): `Snipp_*_aarch64.dmg` | **Intel**: `Snipp_*_x64.dmg` | |
| After installing, remove the quarantine flag: | |
| ``` | |
| xattr -d com.apple.quarantine /Applications/Snipp.app | |
| ``` | |
| files: | | |
| artifacts/**/*.dmg | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |