Releasing
The package is versioned with Changesets and published to GitHub Packages by a GitHub Actions workflow that is started by hand.
Add a changeset with every change
Section titled “Add a changeset with every change”In the pull request that changes the library:
pnpm changesetPick the bump and write one or two sentences for the changelog. They are read by the people upgrading, so say what changed for them.
| Bump | When |
|---|---|
patch |
A bug fix or a visual correction that needs no change in apps. |
minor |
A new component, prop, variant, icon or token. |
major |
A removed or renamed component, prop, token or CSS class; a changed default. |
While the version is below 1.0, breaking changes go out as minor. Say so clearly in the
changeset, as the 0.3.0 entry for the rename to Sulmu UI does.
Publish
Section titled “Publish”There are two ways to turn changesets into a release. Both end with the Release workflow.
A. Version locally, then run the workflow
Section titled “A. Version locally, then run the workflow”This is how the releases so far were made.
-
On
main, with a clean working tree, apply the changesets:Terminal window pnpm changeset versionThis bumps
versioninpackage.json, writesCHANGELOG.mdand deletes the changeset files. -
Commit and push to
main:Terminal window git commit -am "Release 0.4.0"Terminal window git push -
On GitHub, open Actions, choose Release, and press Run workflow on
main. With no changesets left, the workflow builds the package and publishes the new version.
B. Let the workflow open the version pull request
Section titled “B. Let the workflow open the version pull request”-
Merge pull requests that contain changesets into
main. -
Run the Release workflow. Because changesets exist, it opens a pull request called “Version Packages” with the version bump and the changelog.
-
Review and merge that pull request.
-
Run the Release workflow again. This time it publishes.
What the workflow does
Section titled “What the workflow does”.github/workflows/release.yml runs only on workflow_dispatch. It installs with the frozen
lockfile on the Node version in .nvmrc, then runs changesets/action with
publish: pnpm release, which is pnpm build && changeset publish. It authenticates to GitHub
Packages with the workflow’s own GITHUB_TOKEN, so no secret has to be created.
What gets published is set by files in package.json: dist, tokens, icons/svg and
illustrations. The docs folder and Storybook are not part of the package.
After a release
Section titled “After a release”- Check the new version on the repository’s Packages page.
- Upgrade the apps:
yarn up @beyul/sulmu-uiin the frontend, then run its tests. - This site is built from
main, so it shows the released components once Vercel has finished the deployment for that commit.