Skip to content

Commit 350a70e

Browse files
committed
Allow providing ref in manual release flow
1 parent e0bc98e commit 350a70e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
reuse_run_id:
1010
description: "Run ID to reuse build artifacts from, skipping build/PyPI/conda (leave empty for a normal release)"
1111
required: false
12+
tag:
13+
description: "Release tag, e.g. 1.8.0 (only used when reuse_run_id is set; the dispatch ref is not the tag)"
14+
required: false
1215
prerelease:
1316
description: "Mark as a prerelease (only used when reuse_run_id is set)"
1417
type: boolean
@@ -255,6 +258,8 @@ jobs:
255258
steps:
256259
- name: Checkout the tagged source
257260
uses: actions/checkout@v6
261+
with:
262+
ref: ${{ inputs.tag || github.ref_name }}
258263

259264
- name: Download Python distributions
260265
uses: actions/download-artifact@v4
@@ -292,10 +297,11 @@ jobs:
292297
env:
293298
GH_TOKEN: ${{ github.token }}
294299
PRERELEASE: ${{ needs.build.outputs.prerelease || inputs.prerelease }}
300+
TAG: ${{ inputs.tag || github.ref_name }}
295301
run: |
296-
args=(--verify-tag --generate-notes --title "$GITHUB_REF_NAME")
302+
args=(--verify-tag --generate-notes --title "$TAG")
297303
if [[ "$PRERELEASE" == "true" ]]; then
298304
args+=(--prerelease)
299305
fi
300306
mapfile -t assets < <(find artifacts -type f)
301-
gh release create "$GITHUB_REF_NAME" "${assets[@]}" "${args[@]}"
307+
gh release create "$TAG" "${assets[@]}" "${args[@]}"

0 commit comments

Comments
 (0)