Skip to content

Commit 061e94a

Browse files
authored
Update GHA to allow manually supplying tag, and always using tag. (#125)
1 parent 3a98f3a commit 061e94a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/release.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
types: [published]
66
workflow_dispatch:
77
inputs:
8+
tag:
9+
description: "Tag to release (e.g. v0.0.1)"
10+
required: true
811
skip_publish:
912
description: "Skip binary publish"
1013
required: false
@@ -17,6 +20,10 @@ on:
1720
description: "Skip homebrew publish"
1821
required: false
1922
default: "false"
23+
skip_validate:
24+
description: "Skip GoReleaser validation"
25+
required: false
26+
default: "false"
2027

2128
permissions:
2229
contents: write
@@ -30,6 +37,17 @@ jobs:
3037
with:
3138
fetch-depth: 0
3239

40+
- name: Checkout release tag
41+
run: |
42+
git fetch --tags
43+
TAG="${{ github.event.release.tag_name || github.event.inputs.tag }}"
44+
if [ -z "$TAG" ]; then
45+
echo "Error: No tag provided in release event or workflow_dispatch input"
46+
exit 1
47+
fi
48+
echo "Checking out tag $TAG"
49+
git checkout -- "refs/tags/$TAG"
50+
3351
- name: Set up Go (from go.mod)
3452
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3553
with:
@@ -56,6 +74,7 @@ jobs:
5674
args: >
5775
release --clean
5876
${{ github.event.inputs.skip_publish == 'true' && ' --skip publish' || '' }}
77+
${{ github.event.inputs.skip_validate == 'true' && ' --skip validate' || '' }}
5978
${{ github.event.inputs.skip_docker == 'true' && ' --skip docker' || '' }}
6079
${{ github.event.inputs.skip_homebrew == 'true' && ' --skip homebrew' || '' }}
6180
env:

0 commit comments

Comments
 (0)