Skip to content

Commit a599c01

Browse files
committed
build(release): support /promote and /finalize comment commands
- Add workflow_call trigger to release_promote_rc.yaml. - Update on_issue_comment.yaml to parse /promote and /finalize commands, extract version from issue title, and trigger release_promote_rc.yaml. - Document the new commands in release_tracking_template.md. - Restructure RELEASING.md steps to match the 6-step release process.
1 parent 8cd82d2 commit a599c01

4 files changed

Lines changed: 45 additions & 38 deletions

File tree

.github/ISSUE_TEMPLATE/release_tracking_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Maintainers can trigger automation by:
4949
workflow.
5050
- `/process-backports` at the beginning of a line to trigger the Process
5151
Backports workflow.
52+
- `/promote` or `/finalize` at the beginning of a line to trigger the
53+
Promote RC workflow.
5254

5355
</details>
5456

.github/workflows/on_issue_comment.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,29 @@ jobs:
2727
outputs:
2828
command: ${{ steps.parse.outputs.command }}
2929
issue_number: ${{ github.event.issue.number }}
30+
version: ${{ steps.parse.outputs.version }}
3031
steps:
3132
- name: Parse comment
3233
id: parse
3334
env:
3435
COMMENT_BODY: ${{ github.event.comment.body }}
36+
ISSUE_TITLE: ${{ github.event.issue.title }}
3537
run: |
3638
if echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/create-rc([[:space:]]|$)'; then
3739
echo "command=create-rc" >> "$GITHUB_OUTPUT"
3840
elif echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/prepare([[:space:]]|$)'; then
3941
echo "command=prepare" >> "$GITHUB_OUTPUT"
4042
elif echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/process-backports([[:space:]]|$)'; then
4143
echo "command=process-backports" >> "$GITHUB_OUTPUT"
44+
elif echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/(promote|finalize)([[:space:]]|$)'; then
45+
version=$(echo "$ISSUE_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
46+
if [ -n "$version" ]; then
47+
echo "command=promote" >> "$GITHUB_OUTPUT"
48+
echo "version=$version" >> "$GITHUB_OUTPUT"
49+
else
50+
echo "command=none" >> "$GITHUB_OUTPUT"
51+
echo "Error: Could not parse version from issue title for promotion." >&2
52+
fi
4253
else
4354
echo "command=none" >> "$GITHUB_OUTPUT"
4455
fi
@@ -66,3 +77,11 @@ jobs:
6677
with:
6778
issue: ${{ needs.parse_comment.outputs.issue_number }}
6879
secrets: inherit
80+
81+
call_promote:
82+
needs: parse_comment
83+
if: needs.parse_comment.outputs.command == 'promote'
84+
uses: ./.github/workflows/release_promote_rc.yaml
85+
with:
86+
version: ${{ needs.parse_comment.outputs.version }}
87+
secrets: inherit

.github/workflows/release_promote_rc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
description: 'The final version to release (e.g., 0.38.0)'
88
required: true
99
type: string
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: 'The final version to release (e.g., 0.38.0)'
14+
required: true
15+
type: string
1016

1117
permissions:
1218
contents: write

RELEASING.md

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,24 @@ Release Tracking Issue and automated workflows triggered by comments or issue ed
1313

1414
### Steps
1515

16-
1. **Prepare the Release**: Manually run the **Release: Prepare** workflow from
17-
the GitHub Actions UI (or via `gh workflow run`), leaving the `issue` input
18-
empty. This workflow will:
19-
* Automatically determine the next version based on news entries.
20-
* Create a new **Release Tracking Issue** (which serves as the central
21-
hub and checklist for the release).
22-
* Create a `prepare-X.Y.Z` branch.
23-
* Update `CHANGELOG.md` and version placeholders.
24-
* Create a Pull Request with these changes.
25-
26-
2. **Review and Merge**: Review, approve, and merge the generated Pull Request.
27-
Once merged:
28-
* The **Release: Complete Prepare** workflow will automatically mark the
29-
"Prepare Release" task as complete on the tracking issue checklist.
30-
* The **Release: Create Release Branch** workflow will then automatically
31-
run (triggered by the issue edit) to cut the `release/X.Y` branch and
32-
mark the "Create Release branch" task as complete.
33-
34-
3. **Tag Release Candidate (RC)**: Comment `/create-rc` on the tracking issue.
35-
This triggers the **Release: Create RC** workflow, which:
36-
* Tags the release branch with `X.Y.Z-rcN`.
37-
* Triggers the **Release: Publish** workflow to publish the release.
38-
39-
4. **Announce and Wait**: Announce the RC release (see [Announcing
40-
releases](#announcing-releases)) and wait for feedback.
41-
42-
5. **Handle Backports (if needed)**: If bugs need to be fixed in the release:
43-
* Cherry-pick the fixes into the release branch (see [Patch release with
44-
cherry picks]).
45-
* Add the backported PRs to the `## Backports` section of the tracking
46-
issue.
47-
* Comment `/process-backports` on the tracking issue to update the checklist.
48-
* Comment `/create-rc` again to tag a new RC (e.g. `rc1`).
49-
50-
6. **Final Release**: Once the RC is stable, promote it to final release by
51-
manually triggering the **Release: Promote RC** workflow from the GitHub
52-
Actions UI (or using `gh workflow run`), specifying the final version
53-
(e.g., `0.38.0`).
16+
1. **Prepare the Release**: Run the **Release: Prepare** workflow manually. It
17+
will automatically determine the next version, create a release tracking
18+
issue, and send a preparation PR.
19+
20+
2. **Approve and Merge**: Approve and merge the PR. Once merged, a release
21+
branch will be created automatically.
22+
23+
3. **Add Backports (if needed)**: If there are backports, add them following
24+
the "How to add backports" steps.
25+
26+
4. **Create an RC**: Comment `/create-rc` on the tracking issue. All pending
27+
backports must be successfully processed before creating the RC.
28+
29+
5. **Iterate**: Repeat steps 3 and 4 until backports and RCs are no longer
30+
needed.
31+
32+
6. **Finalize the Release**: Comment `/promote` or `/finalize` on the
33+
tracking issue to finalize the release.
5434

5535

5636
### Manually triggering the release workflow

0 commit comments

Comments
 (0)