Release #3
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g. 0.1.1)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: aarch64-macos | |
| name: darwin-aarch64 | |
| - target: x86_64-macos | |
| name: darwin-x86_64 | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Run tests | |
| if: matrix.target == 'aarch64-macos' | |
| run: zig build test | |
| - name: Build release binary | |
| run: zig build -Doptimize=ReleaseFast -Dtarget=${{ matrix.target }} | |
| - name: Rename binary | |
| run: mv zig-out/bin/bru bru-${{ matrix.name }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: bru-${{ matrix.name }} | |
| path: bru-${{ matrix.name }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| chmod +x artifacts/bru-* | |
| gh release create "v${{ inputs.version }}" \ | |
| --title "v${{ inputs.version }}" \ | |
| --generate-notes \ | |
| artifacts/bru-darwin-aarch64 \ | |
| artifacts/bru-darwin-x86_64 | |
| deploy-pages: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./pages | |
| force_orphan: true |