---
name: publish github release artifacts with goreleaser
on:
  push:
    tags: '*'
jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: unshallow
        run: git fetch --prune --unshallow
      - name: setup-go
        uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
      - name: capture current date
        id: date
        run: echo "::set-output name=date::$(date -u '+%Y-%m-%d-%H:%M:%S-%Z')"
      - name: goreleaser
        uses: goreleaser/goreleaser-action@v6
        with:
          version: latest
          args: release --clean
        env:
          DATE: ${{ steps.date.outputs.date }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
