Skip to content

Automate patch release post-publish steps#7308

Draft
alfonso-noriega wants to merge 1 commit intohomebrew-versioned-formulasfrom
automate-patch-post-release
Draft

Automate patch release post-publish steps#7308
alfonso-noriega wants to merge 1 commit intohomebrew-versioned-formulasfrom
automate-patch-post-release

Conversation

@alfonso-noriega
Copy link
Copy Markdown
Contributor

@alfonso-noriega alfonso-noriega commented Apr 15, 2026

WHY are these changes introduced?

Patch releases currently require several manual steps after CI publishes to npm: creating the git tag, opening the GitHub Release, and running `pnpm post-release`. These are mechanical and can be automated, reducing the patch release process to just two human decisions: the cherry-pick PR review and the Homebrew/docs PR review.

WHAT is this pull request doing?

`bin/post-release`:

  • Skips the `dev github print-auth` and `git status` checks when running in CI — `withOctokit` already picks up `GITHUB_TOKEN` automatically so these guards are not needed there.
  • Adds `--skip-notification` flag — patch releases do not send notifications.

`.github/workflows/release.yml`:
Adds two steps after publish that only fire on `stable/*` branches:

  1. Creates and pushes the git tag, then opens the GitHub Release linking to the CHANGELOG.
  2. Runs `pnpm post-release --skip-notification` to open the Homebrew and docs PRs.

Updated patch release steps

Before (7 steps):

  1. Open a cherry-pick PR against `stable/X.Y` and merge it.
  2. Locate and merge the "Version Packages - X.Y" PR — verify it is patch-only.
  3. CI publishes to npm.
  4. `git tag X.Y.Z && git push --tags`
  5. Create GitHub Release manually.
  6. Run `pnpm post-release` from the stable branch; close the notification PR.
  7. Update Observe SLOs and error management rules.

After (4 steps):

  1. Open a cherry-pick PR against `stable/X.Y` and merge it.
  2. Locate and merge the "Version Packages - X.Y" PR — verify it is patch-only.
  3. CI publishes to npm, creates the git tag, opens the GitHub Release, and opens the Homebrew and docs PRs automatically.
  4. Review and merge the Homebrew and docs PRs.
  5. Update Observe SLOs and error management rules.

How to test

The workflow steps can only be fully exercised by a real publish on a stable branch. However:

Test `post-release` changes locally:

Verify the CI path skips the `dev` auth check and notification PR:
```bash

From a stable branch, with a clean or dirty working directory:

CI=true pnpm post-release --skip-notification

Expected: skips git status check, skips dev auth check, skips notification PR, opens Homebrew + docs PRs

```

Verify the flag is required to suppress the notification (i.e. without the flag it still creates it):
```bash
CI=true pnpm post-release

Expected: opens Homebrew + docs + notification PRs

```

Verify the workflow condition logic:

The two new steps only fire when both conditions are true:

  • `steps.changesets.outputs.hasChangesets == 'false'` — a publish actually happened
  • `startsWith(github.ref_name, 'stable/')` — we are on a stable branch, not `main`

You can verify this by triggering the workflow manually on `main` after a publish and confirming the new steps are skipped.

End-to-end test:

Cherry-pick a trivial fix to `stable/X.Y` with a `patch` changeset, merge the resulting "Version Packages" PR, and confirm CI creates the tag, GitHub Release, and Homebrew/docs PRs without manual intervention.

Copy link
Copy Markdown
Contributor Author

alfonso-noriega commented Apr 15, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@alfonso-noriega alfonso-noriega mentioned this pull request Apr 15, 2026
5 tasks
@alfonso-noriega alfonso-noriega force-pushed the automate-patch-post-release branch 2 times, most recently from 20f81b0 to 2a9f602 Compare April 15, 2026 14:13
@alfonso-noriega alfonso-noriega changed the base branch from prepare-semver-support to graphite-base/7308 April 15, 2026 14:19
@alfonso-noriega alfonso-noriega force-pushed the automate-patch-post-release branch from 2a9f602 to 8277e5f Compare April 15, 2026 14:19
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/7308 to homebrew-versioned-formulas April 15, 2026 14:20
After CI publishes a patch to npm on a stable branch, automatically:
- Create and push the git tag
- Create the GitHub Release pointing to the CHANGELOG
- Open Homebrew and docs PRs via pnpm post-release

post-release changes:
- Skip dev auth and git status checks when running in CI
- Add --skip-notification flag (patches do not send notifications)
@alfonso-noriega alfonso-noriega force-pushed the automate-patch-post-release branch from 8277e5f to 9f5a1a8 Compare April 16, 2026 15:01
@alfonso-noriega alfonso-noriega force-pushed the homebrew-versioned-formulas branch from a573648 to 2ac3237 Compare April 16, 2026 15:01
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.

1 participant