Skip to content

Automate tag, stable branch, and GitHub release after changeset publish#7415

Merged
isaacroldan merged 1 commit intomainfrom
04-28-automate_tag_stable_branch_and_github_release_after_changeset_publish
Apr 28, 2026
Merged

Automate tag, stable branch, and GitHub release after changeset publish#7415
isaacroldan merged 1 commit intomainfrom
04-28-automate_tag_stable_branch_and_github_release_after_changeset_publish

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Apr 28, 2026

Summary

Automates the post-merge steps that currently happen by hand after a "Version Packages" PR merges. After pnpm release latest succeeds, the new steps:

  • Create the git tag (X.Y.Z)
  • On main with a minor/major bump (X.Y.0), create the stable/X.Y branch
  • Create the GitHub release with an empty body. Curated, grouped notes still come from /write_release_descriptions, which overwrites the body afterwards.

Each operation checks remote state first and skips if already done, so re-running the workflow recovers cleanly from partial failures. The --latest=legacy flag lets GitHub assign the latest badge via semver comparison, so a patch on the current stable still gets it.

Follow-ups (separate PRs):

  • Auto-label PRs based on changeset presence/content + add .github/release.yml to make --generate-notes produce useful flat notes by default.
  • Automate unlocking main after release (Automatically unlock main branch after release publishes #7416).
  • Out of scope: bin/post-release (homebrew/docs/notification PRs) — needs extra auth.

Test plan

  • Confirm no tag protection rules block GITHUB_TOKEN from pushing tags
  • Confirm no branch protection rules block creating stable/* branches
  • On the next minor cut, watch the workflow run and verify the tag, branch, and (empty-body) release are created with the expected names

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor Author

isaacroldan commented Apr 28, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isaacroldan isaacroldan force-pushed the 04-28-automate_tag_stable_branch_and_github_release_after_changeset_publish branch 3 times, most recently from cde7405 to 854615f Compare April 28, 2026 10:41
Adds five steps to the changeset-release job in release.yml that run
after `pnpm release latest` succeeds:

1. Get version — reads packages/cli/package.json
2. Create tag — bare X.Y.Z, idempotent
3. Create stable branch — only on main with a minor/major bump, idempotent
4. Build release notes — from the .changeset/*.md files consumed by the
   Version Packages merge, with PR + author resolved by walking main's
   first-parent history and reading the merge subject
5. Create GitHub release — reads notes from the file written in step 4,
   --latest=legacy lets GitHub assign the badge by semver

Release notes are scoped to changesets only — anything without a
changeset is excluded by construction. Each step is independently
idempotent, so re-running the workflow recovers from partial failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@isaacroldan isaacroldan force-pushed the 04-28-automate_tag_stable_branch_and_github_release_after_changeset_publish branch from 854615f to fb9e6f5 Compare April 28, 2026 11:04
@isaacroldan isaacroldan marked this pull request as ready for review April 28, 2026 11:15
@isaacroldan isaacroldan requested a review from a team as a code owner April 28, 2026 11:15
Copilot AI review requested due to automatic review settings April 28, 2026 11:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR automates post-publish GitHub repository housekeeping in the existing changeset-release workflow: creating a git tag, optionally creating a stable/X.Y branch on main for .0 releases, and creating a GitHub release (empty body) after pnpm release latest succeeds.

Changes:

  • Derive the released CLI version from packages/cli/package.json after publish.
  • Create and push a git tag named X.Y.Z if it doesn’t already exist remotely.
  • On main for .0 releases, create a stable/X.Y branch if it doesn’t already exist remotely.
  • Create a GitHub release for the tag (empty notes) if it doesn’t already exist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

👏

@isaacroldan isaacroldan added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 1f3f1e7 Apr 28, 2026
29 of 30 checks passed
@isaacroldan isaacroldan deleted the 04-28-automate_tag_stable_branch_and_github_release_after_changeset_publish branch April 28, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants