name: release
on:
  push:
    tags:
      - "*"
jobs:
  publish:
    name: release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          fetch-depth: 0
      - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
        with:
          go-version-file: go.mod
      - run: make release-notes release
        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
      - uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
        with:
          allowUpdates: true
          artifacts: _output/releases/*
          bodyFile: release-notes.md
          token: ${{ secrets.GH_TOKEN }}
      - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
        with:
          name: release-notes
          path: release-notes.md
      - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
        with:
          name: build-artifacts
          path: _output
