Skip to content

Commit 5991cf4

Browse files
committed
fix plugin release workflow: set GORELEASER_CURRENT_TAG to SemVer tag as goreleaser fails otherwise
1 parent 4c3ccbf commit 5991cf4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/plugin.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,22 @@ jobs:
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636

37+
- name: Set GORELEASER_CURRENT_TAG
38+
if: ${{ startsWith(github.ref, 'refs/tags/controller-') }}
39+
run: echo "GORELEASER_CURRENT_TAG=${{ github.ref }}" | sed 's/refs\/tags\/controller-//' >> $GITHUB_ENV
40+
3741
- name: Run GoReleaser
38-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
42+
if: ${{ startsWith(github.ref, 'refs/tags/controller-') }}
3943
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
4044
with:
4145
version: "~> v2"
4246
args: release --clean
4347
env:
4448
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GORELEASER_CURRENT_TAG: ${{ env.GORELEASER_CURRENT_TAG }}
4550

4651
- name: Update new version in krew-index
47-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
52+
if: ${{ startsWith(github.ref, 'refs/tags/controller-') }}
4853
uses: rajatjindal/krew-release-bot@3d9faef30a82761d610544f62afddca00993eef9 # v0.0.47
4954
with:
5055
krew_template_file: cmd/plugin/krew.yaml

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ builds:
2222
ldflags: |
2323
-s -w
2424
-X k8s.io/ingress-nginx/version.COMMIT={{ .Commit }}
25-
-X k8s.io/ingress-nginx/version.RELEASE={{ .Tag }}
25+
-X k8s.io/ingress-nginx/version.RELEASE=controller-{{ .Tag }}
2626
archives:
2727
- id: ingress-nginx
2828
ids:

0 commit comments

Comments
 (0)