name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v6.0.0
        with:
          version: latest
          args: release --clean
          workdir: cmd/flarectl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
