Release #99
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: | |
| permissions: | |
| contents: write # to create releases, tags and upload assets | |
| pull-requests: read # to read pull request titles and labels for changelog | |
| id-token: write # to sign the release | |
| jobs: | |
| goreleaser: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.26.1" | |
| - name: Set up Zig | |
| uses: goto-bus-stop/setup-zig@v2 | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Fetch the new tag | |
| run: git fetch --tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get macOS SDK path | |
| id: macos_sdk | |
| run: echo "path=$(xcrun --show-sdk-path)" >> $GITHUB_OUTPUT | |
| - name: Run GoReleaser | |
| if: steps.tag_version.outputs.new_tag | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| SDK_PATH: ${{ steps.macos_sdk.outputs.path }} | |
| GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| snapcraft: | |
| runs-on: ${{ matrix.runner }} | |
| needs: goreleaser | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Snapcraft and LXD | |
| run: | | |
| sudo snap install snapcraft --classic | |
| sudo snap install lxd | |
| sudo lxd init --auto | |
| sudo iptables -P FORWARD ACCEPT | |
| sudo usermod -aG lxd $USER | |
| - name: Build snap | |
| run: sg lxd -c 'snapcraft pack --use-lxd --build-for=${{ matrix.arch }}' | |
| - name: Upload snap | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| run: snapcraft upload --release=stable *.snap |