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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 0
      -
        name: Set up Go
        uses: actions/setup-go@c0137caad775660c0844396c52da96e560aba63d # 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
