name: Release for GitHub on: push: tags: - v* workflow_dispatch: env: GO_VERSION: 1.24.5 jobs: release: name: Release strategy: matrix: platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 with: go-version: ${{ env.GO_VERSION }} id: go - name: Check out code into the Go module directory uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: fetch-depth: 0 # https://github.com/marketplace/actions/cache - name: Cache Go modules uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- # https://goreleaser.com/ci/actions/ - name: Run GoReleaser uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a #if: startsWith(github.ref, 'refs/tags/v') with: version: latest args: release -f .goreleaser.yml --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}