name: Release on: workflow_dispatch: inputs: release_ref: description: "Git ref to release, preferably a tag like v1.0.1" required: true type: string push: tags: - "v*" permissions: contents: write jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_ref || github.ref }} - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Run tests run: go test ./... - name: GoReleaser uses: goreleaser/goreleaser-action@v6 with: version: latest args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}