Skip to content

Commit a56e165

Browse files
Fix goreleaser tag resolution for CLI
1 parent 3c3e030 commit a56e165

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release-cli.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ jobs:
2121
with:
2222
go-version-file: go.mod
2323

24-
- name: Set CLI version from tag
24+
- name: Create version tag for goreleaser
2525
env:
2626
GIT_TAG: ${{ github.ref_name }}
2727
run: |
28-
echo "GORELEASER_CURRENT_TAG=${GIT_TAG#cli-}" >> $GITHUB_ENV
28+
# Goreleaser needs a semver tag on HEAD. Create a temporary
29+
# v* tag from the cli-v* tag so archives are named correctly.
30+
VERSION_TAG="${GIT_TAG#cli-}"
31+
git tag "$VERSION_TAG"
32+
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
2933
3034
- uses: goreleaser/goreleaser-action@v6
3135
with:
@@ -34,6 +38,10 @@ jobs:
3438
env:
3539
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3640

41+
- name: Clean up version tag
42+
if: always()
43+
run: git tag -d "$VERSION_TAG" 2>/dev/null || true
44+
3745
- name: Load secrets from 1Password
3846
uses: 1password/load-secrets-action@v2
3947
with:

0 commit comments

Comments
 (0)