Release Flow
develop → beta, main → stable: the dual-channel model.
Crown packages use a two-channel release flow:
developpublishes beta snapshots to thebetadist-tag.mainpublishes stable releases to thelatestdist-tag.
Use beta releases to validate changes in downstream apps before promoting those changes to a stable release.
Do not run bun run version locally. The Changesets action runs it when it
creates the stable "Version Packages" pull request.
Release channels
| Channel | Branch | Dist-tag | Version shape | Purpose |
|---|---|---|---|---|
| Beta | develop | beta | 1.0.0-beta.42 | Test pending changes before stable promotion. |
| Stable | main | latest | 1.0.1, 1.1.0, 2.0.0 | Publish the supported release consumers should default to. |
The root scripts are:
bun run version # changeset version
bun run release # turbo run build && changeset publish
bun run release:beta # changeset publish --tag beta --no-git-tagCI decides which script path to use from the branch that received the push.
Choose patch, minor, or major
Every package output or public API change needs a changeset. Pick the bump by consumer impact.
| Change | Bump | Example next stable version |
|---|---|---|
| Backwards-compatible fix or token value tweak | patch | 1.0.0 -> 1.0.1 |
| Backwards-compatible new token, semantic role, component set, or public output | minor | 1.0.0 -> 1.1.0 |
| Breaking rename, removal, restructure, or moved public identifier | major | 1.0.0 -> 2.0.0 |
Rule of thumb: if consumers get new identifiers, use at least minor. If an
existing identifier disappears, moves, or changes meaning in a breaking way, use
major.
@kingpowerclick/crown-css and @kingpowerclick/crown-utils are in a fixed
Changesets group, so they release at the same stable version. Include
@kingpowerclick/crown-tailwind only when its package output or public API
changes.
Write a changeset
Create a file under .changeset/ with a short, unique name. The frontmatter
declares which packages should be released and what bump each package needs.
Patch example:
---
"@kingpowerclick/crown-css": patch
"@kingpowerclick/crown-utils": patch
---
Fix primary button hover token value.Minor example:
---
"@kingpowerclick/crown-css": minor
"@kingpowerclick/crown-utils": minor
---
Add semantic roles for loyalty status colors.Major example:
---
"@kingpowerclick/crown-css": major
"@kingpowerclick/crown-utils": major
---
Rename deprecated semantic color roles.If the Tailwind package changes too, include it in the same changeset:
---
"@kingpowerclick/crown-css": minor
"@kingpowerclick/crown-utils": minor
"@kingpowerclick/crown-tailwind": minor
---
Add theme variables and Tailwind variants for loyalty status colors.Documentation-only changes do not need a changeset.
Publish a beta
Beta publishing is automatic after a PR lands on develop, as long as the repo
has at least one pending .changeset/*.md file.
- Start from
develop.
git checkout develop
git pull
git checkout -b feature/<short-name>-
Make the package changes and add the changeset.
-
Verify locally.
bun install
bun run build
bun run test- Commit, push, and open a PR to
develop.
git add .changeset/<file>.md <changed-files>
git commit -m "feat(css): describe the release change"
git push -u origin feature/<short-name>
gh pr create --base develop- Merge the PR into
develop.
On the develop push, CI builds, tests, verifies committed generated outputs,
then stamps the published packages with:
<current-stable-base>-beta.<github_run_number>For example, if @kingpowerclick/crown-css is currently 1.0.0 and the
workflow run number is 42, CI publishes:
1.0.0-beta.42CI then runs bun run release:beta, which publishes to the beta dist-tag
without creating git tags.
Install a beta in a downstream app with:
bun add @kingpowerclick/crown-css@betaBeta publishing does not consume changesets, does not update changelogs, and
does not commit package version changes back to develop.
The beta version number is a snapshot of the current stable base plus the
GitHub run number. The pending changeset still controls the later stable
patch, minor, or major version, but the beta name itself does not show
that future bump.
Publish a stable release
Stable publishing happens through main.
-
Wait until the accumulated changes on
developare ready to ship. -
Open a PR from
developtomain. -
Merge the PR into
main. -
The push to
mainruns the Changesets action. If there are pending changesets, the action opens a "Version Packages" PR. -
Review the "Version Packages" PR. It should:
- Bump package
versionfields according to the pending changesets. - Regenerate package
CHANGELOG.mdfiles. - Remove the consumed
.changeset/*.mdfiles.
-
Merge the "Version Packages" PR.
-
CI runs
bun run releaseand publishes stable packages to thelatestdist-tag.
Consumers can then install the stable package normally:
bun add @kingpowerclick/crown-cssHow the automation works
The release workflow runs on pushes to develop and main.
Before either publish path, CI:
- Installs dependencies with
bun install --frozen-lockfile. - Runs
bun run build. - Runs
bun run test. - Checks generated outputs for
crown-css,crown-utils, andcrown-tailwind.
Then the branch determines the publish behavior:
| Branch | Behavior |
|---|---|
develop | If pending changesets exist, publish a beta snapshot with bun run release:beta. |
main | Create or publish the stable Changesets release with bun run version and bun run release. |
The packages publish to GitHub Packages using the @kingpowerclick registry
and restricted package access.