Skip to content

Make release workflows branch-agnostic to support releasing from v3 - #680

Merged
fantkolja merged 1 commit into
masterfrom
feature/hzc-0000-enable-release-from-older-branch
Sep 24, 2026
Merged

fantkolja merged 1 commit into
masterfrom
feature/hzc-0000-enable-release-from-older-branch

Conversation

@fantkolja

@fantkolja fantkolja commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • prepare-release.yml and release.yml hardcoded master as the base branch and npm publish --tag canary unconditionally.
  • Generalizes both so they work when dispatched against v3 too: the release PR's base branch and Chromatic's baseBranch now follow the triggering ref, and the npm publish tag is picked dynamically (canary for master, latest for v3, matching the current npm dist-tags: latest → 3.0.13, canary → 4.0.1-canary.19).
  • Companion PR Add PR-gated release workflow to v3, matching master #681 on v3 ports the matching prepare-release.yml/release.yml there (replacing its old direct-push workflow) plus branch protection, since this repo's workflow files are read per-branch.

Test plan

  • YAML validated (js-yaml parse) — done locally
  • Dry-run prepare-release.yml via workflow_dispatch on master to confirm the canary flow is unaffected
  • After Add PR-gated release workflow to v3, matching master #681 lands, dry-run prepare-release.yml on v3 and confirm the release PR opens against v3 and publishes with --tag latest

🤖 Generated with Claude Code

https://claude.ai/code/session_017KZ4BwmV36thDKYibkbaty

prepare-release.yml and release.yml hardcoded `master` as the base
branch and npm publish always used the `canary` dist-tag. Generalize
both so they work when dispatched against v3 too: base branch and
Chromatic baseBranch now follow the triggering ref, the publish step
picks `canary` for master and `latest` for v3 (matching the current
npm dist-tags), and the release trigger now also listens on v3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KZ4BwmV36thDKYibkbaty
@fantkolja
fantkolja requested a review from a team as a code owner September 24, 2026 12:31
@fantkolja
fantkolja merged commit 49ca5a9 into master Sep 24, 2026
4 checks passed
@fantkolja
fantkolja deleted the feature/hzc-0000-enable-release-from-older-branch branch September 24, 2026 12:46
fantkolja added a commit that referenced this pull request Sep 24, 2026
## Summary
- `v3` has been releasing via a single workflow (`release.yml`, "manual
release") that bumps the version, pushes the commit directly to `v3`,
and runs `npm publish` unconditionally. That only worked because `v3`
had no branch protection.
- Replaces it with the same two-step flow `master` uses:
`prepare-release.yml` (new) opens a version-bump PR with auto-merge
enabled, and `release.yml` publishes once it's approved and merged —
tagging with npm's `latest` dist-tag, since `v3` is the current stable
line (`canary` is reserved for `master`/v4 prereleases). Companion PR
#680 makes those two files branch-agnostic on `master`'s
side.
- Adds `.github/CODEOWNERS` so the new PR review requirement has an
owner to route to.
- Fixes `pull-request.yml`, whose `branches: [master]` filter meant CI
(`lint`/`test`) silently never ran on PRs targeting `v3` — only the CLA
check did (verified against open PR #676).

Branch protection on `v3` (require PR + 1 code owner approval, no
force-push/deletion — matching `master`) has already been enabled via
the API, so this PR itself needed a review to merge.

## Test plan
- [ ] YAML validated (`js-yaml` parse) — done locally
- [ ] Confirm CI now runs on this PR (previously only the CLA check
fired for `v3`-targeted PRs)
- [ ] After merge, dry-run `prepare-release.yml` via `workflow_dispatch`
on `v3` and confirm it opens a release PR against `v3` and publishes
with `--tag latest`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_017KZ4BwmV36thDKYibkbaty

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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