1---
 2name: Build release binaries
 3
 4on:
 5  push:
 6    tags:
 7      - "v*"
 8
 9concurrency:
10  group: release-${{ github.ref }}
11  cancel-in-progress: true
12
13permissions:
14  contents: read
15
16jobs:
17  build-release:
18    runs-on: "ubuntu-latest"
19    permissions:
20      # unfortunately, this is necessary for creating the release. there is a
21      # comnunity discussion tracking a request to implement a more granular
22      # permission that as of writing, has not seen any activity since 2023 [0].
23      #
24      # [0]: https://github.com/orgs/community/discussions/68252
25      contents: write
26    steps:
27      - name: Check out code
28        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29
30      - name: Set up Go
31        uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
32        with:
33          go-version: 1.24.2
34
35      - name: Build
36        run: make
37
38      - name: Setup minimal git config
39        run: |
40          git config --global user.email "action@github.com"
41          git config --global user.name "GitHub Action"
42
43      - name: Test
44        run: make test
45
46      - name: Build binaries
47        run: make releases
48
49      - uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
50        with:
51          repo_token: "${{ secrets.GITHUB_TOKEN }}"
52          draft: true
53          prerelease: false
54          files: dist/*