name: goreleaser

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: write # for goreleaser/goreleaser-action to create a GitHub release

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0
      -
        name: Set up Go
        uses: actions/setup-go@a5f9b05d2d216f63e13859e0d847461041025775 # v5.2.0
        with:
          go-version: 1.25.x
      -
        name: Run GoReleaser
        uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
        with:
          version: 2.11.2
          args: release --clean
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CGO_ENABLED: 0
