Releasing a widget
pnpm release: the version bump and changelog entry, as a pull request into dev, before the dev → main pull request.
A widget publishes when dev is merged into main: the deploy builds an
immutable /v<version>/ and moves /latest/ to it. It publishes only a
new version: merged without a version bump, the release build finds that
version already live and does nothing. The pull request's CI says so first
(below).
pnpm release makes that bump, with the changelog entry that goes with it,
as a pull request into dev. It never pushes to dev itself:
git switch dev && git pull
pnpm release minor # or patch, or major
# merge its pull request into dev, then open the dev → main pull requestWhat it does
At origin/dev, with nothing uncommitted, on dev or on a branch of your
own made from it:
- Bumps
package.json'sversion:patchfor fixes,minorfor features,majorfor a change that asks something of the people using the widget (a column to map again, an access level raised). - Writes the
CHANGELOG.mdentry: one line per changedevhas thatmaindoesn't, from the merged pull requests' titles, whether they were squashed or merged with a merge commit (other merges and earlier release commits left out). It createsCHANGELOG.mdif it is missing, and notes in the entry, as a comment, the commit the release was made from. - Commits both as
release: v<version>, on a new branchrelease/v<version>. - Pushes the branch and opens its pull request into
dev, with the GitHub CLI. Withoutgh, it prints the link that opens it.
Once that pull request is merged, open the dev → main pull request (the
command prints its link). Merging it, once its checks are green, is the
release.
Its options:
--branch <name>names the branch, for an agent kept to branches of its own;--no-prstops after the commit, before the push.
It refuses to run on main, with uncommitted changes, away from
origin/dev, before the widget's first release (the first merge of dev
into main sets the first version), or when dev has nothing main
doesn't. If the push is refused, the commit stays on its branch and the
message says why.
What CI checks on the pull request into main
A pull request into main is a release, so ci.yml runs two more jobs on
it, besides lint, tests and build (check). The main ruleset requires
release as well as check:
create-grist-widget release-checkbuilds the widget as the release does and compares it with the publishedv<version>/:- nothing published yet, or a new version: the merge publishes it;
- a new version with commits after the one that set it, or that reached
devafter its release branch was made: it fails, since those commits would be released without their changelog line (commitsmainalready has don't count). Runpnpm releaseagain, so the changelog lists all of it; - the version already published and the same build (a docs change, say): it passes, and the merge releases nothing;
- the version already published and another build: it fails. Raise the
version on
dev, or keep the change there until the next release. A Dependabot pull request opened onmain, as its security updates are, fails it too: close it, and take its update throughdev.
create-grist-widget check, in thegristjob, opens the widget in a real Grist and compares it with its last release, pixel by pixel. The comparison is in the job's summary. The job isn't required, so a slow Docker pull never holds a release.
After the merge, the deploy's verify job runs
verify-release:
v<version>/ is served, and /latest/ is on the same build.
When to release
After the change has been checked in a real Grist document on /dev/. A
widget that takes SDK updates releases after merging them into dev
(Upgrading a widget): its users get the fixes the
update carries.