From 4681091d94282db0d6ce28ae920e4dbfe312645e Mon Sep 17 00:00:00 2001 From: cnwaldron <72021941+cnwaldron@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:21:52 -0500 Subject: [PATCH] Add step for snapshot Only run release steps on tags to avoid failure --- .github/workflows/plugin.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/plugin.yaml b/.github/workflows/plugin.yaml index ab88454fb..b6f3bda9e 100644 --- a/.github/workflows/plugin.yaml +++ b/.github/workflows/plugin.yaml @@ -25,7 +25,17 @@ jobs: go-version: '1.21.3' check-latest: true + - name: Run GoReleaser Snapshot + if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + version: latest + args: release --snapshot --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser + if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 with: version: latest @@ -34,6 +44,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update new version in krew-index + if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: rajatjindal/krew-release-bot@df3eb197549e3568be8b4767eec31c5e8e8e6ad8 # v0.0.46 with: krew_template_file: cmd/plugin/krew.yaml