diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 73a99be268..2070ad94f7 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -1,8 +1,13 @@ name: Release Binaries on: - release: - types: [ published ] + push: + # Sequence of patterns matched against refs/tags + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" # Push events to matching v*, i.e. v1.0, v20.15.10, v1.2.3-hotfix, etc. + +permissions: + contents: write # for goreleaser/goreleaser-action to create a GitHub release jobs: binary: @@ -14,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.21 - name: Checkout uses: actions/checkout@v3 @@ -22,11 +27,14 @@ jobs: path: ${{ env.working-directory }} fetch-depth: 0 + - env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: |- + echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: workdir: ${{ env.working-directory }} version: 1.13.0 - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + args: release --rm-dist \ No newline at end of file