Skip to content

Commit 193b2c2

Browse files
committed
release: allow cutting a release from workflow_dispatch
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9LuNru5frNFbibH1iervi
1 parent d93bc40 commit 193b2c2

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ on:
44
push:
55
tags:
66
- "v*.*.*"
7+
# Manual path for cutting a release without pushing a tag first; the
8+
# publish step creates the tag on the commit the run was started from.
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: "Tag to release, e.g. v0.1.0 (must match Cargo.toml)"
13+
required: true
14+
15+
env:
16+
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
717

818
permissions:
919
contents: write
@@ -17,10 +27,10 @@ jobs:
1727
- uses: actions/checkout@v4
1828
- name: Verify the tag matches Cargo.toml's version
1929
run: |
20-
tag_version="${GITHUB_REF_NAME#v}"
30+
tag_version="${RELEASE_TAG#v}"
2131
cargo_version=$(grep -m1 '^version' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
2232
if [ "$tag_version" != "$cargo_version" ]; then
23-
echo "Tag $GITHUB_REF_NAME doesn't match Cargo.toml version $cargo_version" >&2
33+
echo "Tag $RELEASE_TAG doesn't match Cargo.toml version $cargo_version" >&2
2434
exit 1
2535
fi
2636
@@ -111,6 +121,8 @@ jobs:
111121
- name: Publish release
112122
uses: softprops/action-gh-release@v2
113123
with:
124+
tag_name: ${{ env.RELEASE_TAG }}
125+
target_commitish: ${{ github.sha }}
114126
generate_release_notes: true
115127
files: |
116128
dist/formwatch-*

0 commit comments

Comments
 (0)