44 push :
55 tags :
66 - " v*.*.*"
7+ workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : " Git tag to release (e.g. v0.0.4)"
11+ required : true
12+ type : string
713
814permissions :
915 contents : write
1016 packages : write
1117
18+ # Resolve the tag once: prefer the workflow_dispatch input, fall back to the
19+ # push-event ref. Every job references this via env.RELEASE_TAG.
20+ env :
21+ RELEASE_TAG : ${{ inputs.tag || github.ref_name }}
22+
1223defaults :
1324 run :
1425 shell : bash
3546 steps :
3647 - uses : actions/checkout@v4
3748 with :
49+ ref : ${{ inputs.tag || github.ref }}
3850 fetch-depth : 0
3951
4052 - name : Mark workspace safe for git
4961 set -euo pipefail
5062 echo "python=$(uv run python tasks/scripts/release.py get-version --python)" >> "$GITHUB_OUTPUT"
5163 echo "cargo=$(uv run python tasks/scripts/release.py get-version --cargo)" >> "$GITHUB_OUTPUT"
52- echo "semver=${GITHUB_REF_NAME #v}" >> "$GITHUB_OUTPUT"
64+ echo "semver=${RELEASE_TAG #v}" >> "$GITHUB_OUTPUT"
5365
5466 - name : Find previous release tag
5567 id : prev
5971 # stable releases (no pre-release suffixes like -rc1), skip the current tag
6072 PREV=$(git tag --list 'v*.*.*' --sort=-version:refname \
6173 | grep -P '^v\d+\.\d+\.\d+$' \
62- | grep -v "^${GITHUB_REF_NAME }$" \
74+ | grep -v "^${RELEASE_TAG }$" \
6375 | head -n1 || true)
6476 echo "tag=${PREV}" >> "$GITHUB_OUTPUT"
6577 echo "Previous release tag: ${PREV:-"(none, first release)"}"
@@ -131,6 +143,7 @@ jobs:
131143 steps :
132144 - uses : actions/checkout@v4
133145 with :
146+ ref : ${{ inputs.tag || github.ref }}
134147 fetch-depth : 0
135148
136149 - name : Log in to GHCR
@@ -186,6 +199,7 @@ jobs:
186199 steps :
187200 - uses : actions/checkout@v4
188201 with :
202+ ref : ${{ inputs.tag || github.ref }}
189203 fetch-depth : 0
190204
191205 - uses : actions/setup-python@v5
@@ -272,6 +286,7 @@ jobs:
272286 steps :
273287 - uses : actions/checkout@v4
274288 with :
289+ ref : ${{ inputs.tag || github.ref }}
275290 fetch-depth : 0
276291
277292 - name : Mark workspace safe for git
@@ -358,6 +373,7 @@ jobs:
358373 steps :
359374 - uses : actions/checkout@v4
360375 with :
376+ ref : ${{ inputs.tag || github.ref }}
361377 fetch-depth : 0
362378
363379 - name : Mark workspace safe for git
@@ -409,6 +425,8 @@ jobs:
409425 timeout-minutes : 10
410426 steps :
411427 - uses : actions/checkout@v4
428+ with :
429+ ref : ${{ inputs.tag || github.ref }}
412430
413431 - name : Download all CLI artifacts
414432 uses : actions/download-artifact@v4
@@ -433,14 +451,14 @@ jobs:
433451 - name : Create GitHub Release
434452 uses : softprops/action-gh-release@v2
435453 with :
436- name : OpenShell ${{ github.ref_name }}
454+ name : OpenShell ${{ env.RELEASE_TAG }}
437455 prerelease : false
438- tag_name : ${{ github.ref_name }}
456+ tag_name : ${{ env.RELEASE_TAG }}
439457 generate_release_notes : false
440458 body : |
441- ## OpenShell ${{ github.ref_name }}
459+ ## OpenShell ${{ env.RELEASE_TAG }}
442460
443- ${{ needs.compute-versions.outputs.previous_tag != '' && format('**Full changelog**: [{0}...{1}](https://github.com/{2}/compare/{0}...{1})', needs.compute-versions.outputs.previous_tag, github.ref_name , github.repository) || '' }}
461+ ${{ needs.compute-versions.outputs.previous_tag != '' && format('**Full changelog**: [{0}...{1}](https://github.com/{2}/compare/{0}...{1})', needs.compute-versions.outputs.previous_tag, env.RELEASE_TAG , github.repository) || '' }}
444462
445463 ### Quick install
446464
@@ -454,7 +472,7 @@ jobs:
454472 Darwin-arm64) ASSET="openshell-aarch64-apple-darwin.tar.gz" ;; \
455473 *) echo "Unsupported platform: ${OS}-${ARCH}" >&2; exit 1 ;; \
456474 esac; \
457- gh release download ${{ github.ref_name }} --repo NVIDIA/OpenShell --pattern "${ASSET}" -O - \
475+ gh release download ${{ env.RELEASE_TAG }} --repo NVIDIA/OpenShell --pattern "${ASSET}" -O - \
458476 | tar xz \
459477 && sudo install -m 755 openshell /usr/local/bin/openshell'
460478 ```
0 commit comments