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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
        with:
          fetch-depth: 0
      -
        name: Set up Go
        uses: actions/setup-go@dca8468d37b6d090cde2c7b97b738a37134f5ffb # v5.2.0
        with:
          go-version: 1.24.x
      -
        name: Run GoReleaser
        uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
        with:
          version: 2.3.2
          args: release --clean
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CGO_ENABLED: 0
