Skip to content

Add prepare-release-notes and create-draft-release scripts - #2556

Merged
westonruter merged 4 commits into
trunkfrom
add/prepare-release-notes-script
Jul 18, 2026
Merged

Add prepare-release-notes and create-draft-release scripts#2556
westonruter merged 4 commits into
trunkfrom
add/prepare-release-notes-script

Conversation

@westonruter

Copy link
Copy Markdown
Member

This introduces two new scripts that help automate the release process:

  • npm run gather-release-notes
  • npm run create-draft-release

The former is called automatically be the later. I've updated the handbook page to explain how they are used. I used them in the most recent release.

Use of AI Tools

Changes were authored by Claude Opus 4.8 based on my prompts.

westonruter and others added 2 commits June 30, 2026 18:58
Assemble the release notes for the plugins currently being released — those
with an open, dated milestone whose title does not contain "n.e.x.t" — by
reading each plugin's stable-tag changelog entry from its readme.txt (as
populated by npm run readme). Progress and warnings go to STDERR so STDOUT (the
Markdown notes) can be piped to a file or the clipboard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Create a draft GitHub release for the release date, using the combined
per-plugin changelogs from `npm run prepare-release-notes` as the body. The tag
and title are $RELEASE_DATE and the target is the release/$RELEASE_DATE branch.

Fails early if the target branch is missing on origin or a release for the tag
already exists, and authenticates the milestone lookup with the gh token to
avoid rate limiting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@westonruter westonruter added the [Type] Enhancement A suggestion for improvement of an existing feature label Jul 1, 2026
@westonruter westonruter added the skip changelog PRs that should not be mentioned in changelogs label Jul 1, 2026
@westonruter
westonruter requested a review from thelovekesh as a code owner July 1, 2026 02:01
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.35%. Comparing base (6bce616) to head (bd13368).
⚠️ Report is 34 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #2556      +/-   ##
==========================================
- Coverage   70.38%   70.35%   -0.03%     
==========================================
  Files          91       91              
  Lines        7850     7867      +17     
==========================================
+ Hits         5525     5535      +10     
- Misses       2325     2332       +7     
Flag Coverage Δ
multisite 70.35% <ø> (-0.03%) ⬇️
single 35.17% <ø> (-0.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: b1ink0 <b1ink0@git.wordpress.org>
Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter added the no milestone PRs that do not have a defined milestone for release label Jul 2, 2026
@westonruter
westonruter requested a review from b1ink0 July 3, 2026 20:23

@b1ink0 b1ink0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread bin/create-draft-release.sh Outdated
Comment on lines +41 to +46
# Avoid clobbering an existing release/tag; drafts are cheap to delete and recreate.
if gh release view "$tag" &> /dev/null; then
echo "Error: A release for tag \"$tag\" already exists. Delete it first with:" >&2
echo " gh release delete \"$tag\"" >&2
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know we are not suggesting to delete an already published release? Maybe check if it's a draft and then suggest to delete it?

Also, maybe add a macro if there could be more releases per day? like YYYY-MM-DD.N?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only create tags for releases, right? Er, the other way around. We only create a tag and a release at the same time following this scheme. So if it already exists, then that means the release was already made and the user should change the release target. So perhaps this message should advise to only delete if a mistake had been made. Otherwise, a corrected version should be supplied.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if it already exists, then that means the release was already made and the user should change the release target.

Yes, and this message shouldn't suggest deleting it, right? given it's not even possible to delete if it's an immutable release.

If this is just a draft (and the tag may also need to point to the latest commit), then it's okay to suggest deleting the existing release and tag. But if it's not a draft and has already been published, it should simply say: A release for this tag already exists and can't be overridden.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thelovekesh How about bd13368?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great.

Comment thread bin/create-draft-release.sh Outdated
westonruter and others added 2 commits July 7, 2026 12:46
Co-authored-by: thelovekesh <lovekesh.kumar@rtcamp.com>
Only suggest `gh release delete` when the existing release is still a
draft. A published release is immutable, so advise supplying a
different RELEASE_DATE instead.

Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@westonruter
westonruter merged commit 87b022f into trunk Jul 18, 2026
34 of 36 checks passed
@westonruter
westonruter deleted the add/prepare-release-notes-script branch July 18, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants