Releasing
How to release the standalone june: a release PR, a tag, and a workflow that builds, tests, signs and publishes it to GitHub Releases. Every step is a make target, so you can run any of them locally. Distribution explains how it all works.
Not set up yet. Nothing has been released. The public release repository, its GitHub App, the signing key and the
releaseenvironment below must be created once, by a person, before the first release. Until then the release workflow builds and tests everything and then stops, saying what's missing.
Release a version
-
Prepare. On a branch, bump the version and move the changelog's notes under it, then open a PR like any other:
make release:prepare bump=minor # or major, patch, rc, release, or 0.3.0rcmakes the next release candidate (0.2.1-rc.1, then-rc.2) and leaves the notes under Unreleased;releaseturns a candidate into its stable release. The PR needs nothing butpackages/june/package.jsonandCHANGELOG.md. -
Merge it. The
Tag June releasesworkflow tags the merge commitjune-v<version>and startsRelease June. Any other change to the package'spackage.json, or a rerun, finds the version already tagged and does nothing. -
Approve.
Release Junechecks the tag, builds every platform once, smoke tests each one natively, rehearses the release on a fake GitHub and runs the lifecycle tests. The publish job then waits for approval in thereleaseenvironment. Approve it to sign and publish. -
Check it:
curl -fsSL https://june.dev/install.sh | bash -s -- --version <version> june --version
A release candidate is published as a prerelease, which june upgrade and the install scripts never take unless asked for by version. A stable release becomes GitHub's latest only after every asset has been downloaded anonymously and verified.
You can also tag by hand (make release:tag push=1 on an up-to-date main), which starts Release June the same way.
Rehearse
Nothing here needs a credential or publishes anything:
make verify:cli # build this machine's june and smoke test its archive with no Bun on PATH
make release:dry-run # build, sign with a throwaway key, publish twice to a fake GitHub, install it with install.sh
make test:distribution # install, upgrade, pin, roll back and break three real versions on a fake GitHub
make release:tag dry=1 # say what tag main would get
Release June can also be run from the Actions tab with dry_run (the default): it builds, smoke tests and rehearses a tag or branch, and skips publishing.
Every step
| Command | Does |
|---|---|
make release:prepare bump=<b> | Bumps packages/june for a release PR (dry=1 changes nothing) |
make release:tag [push=1] | Tags HEAD june-v<version> if that version has no tag and is newer than every release |
make release:check-tag tag=<t> | Refuses a tag whose package version differs or whose commit isn't on main |
make build:cli [platforms=…] [host=1] | Builds the archives and inventory.json into packages/june/out/release |
make verify:cli [dir=<build>] | Smoke tests this machine's archive from a build |
make release:sign [dir=] [key=<pem>] | Writes manifest.json, manifest.sig and checksums.txt; the key must be a trusted one |
make release:verify [dir=] | Checks a signed build the way installers do |
make release:publish repo=<r> commit=<sha> | Publishes a signed build (token in JUNE_RELEASE_TOKEN; dry=1) |
When something fails
- The tag doesn't match the package version, or isn't on
main.release:check-tagstops the release before anything is built. Delete the tag if nothing was published, fix the version in a PR, and let the merge tag it. - A build, smoke test or rehearsal fails. Nothing is published, and the latest release is unchanged. Fix it on
mainwith a new patch version; a published version is never rebuilt. - Publishing fails part way. A release that didn't finish is a draft or a prerelease, never latest. Rerun the failed
Release Junerun:release:publishuploads only what's missing, checks every asset's digest and picks up where it stopped. It refuses to replace any asset of a published release with different bytes. - The workflow says the
releaseenvironment is missing something. Finish the one-time setup; the build is kept as the run'sjune-releaseartifact for 14 days, and rerunning the publish job uses it.
A bad release
Published assets are never changed or deleted by the release tooling. To pull a bad stable release back:
- Make the previous release latest again:
gh release edit june-v<previous> --repo johno/june-releases --latest. New installs andjune upgradeget it at once. - Tell people who upgraded to run
june rollback, orjune upgrade --version <previous>. - Release the fix as a new patch version.
Set up once
These are manual steps for a person with admin access; nothing in the repository does them.
-
Create the public release repository
johno/june-releaseswith a README, so it has a default branch for release tags. Turn on immutable releases in its settings, so a published release's assets and tag can't change. -
Create a GitHub App with Contents: read and write, installed on
johno/june-releasesonly. Its token is the only credential that can publish. -
Make the release signing key on a trusted machine:
bun packages/june/src/release/cli.ts keygen --out ~/june-release-keyPut the public key line in
src/distribution/keys.tsand inRELEASE_KEYSininstall/install.shandinstall/install.ps1(a test checks they match), in a PR. Keep the private key's PEM somewhere safe offline too. -
Create the
releaseenvironment injohno/junewith required reviewers and deployment limited tomainandjune-v*tags (the tag workflow releases frommain; a tag you push releases from the tag), and give it:- secrets
JUNE_RELEASE_SIGNING_KEY(the PEM),JUNE_RELEASE_APP_IDandJUNE_RELEASE_APP_PRIVATE_KEY; - the variable
JUNE_RELEASE_REPO=johno/june-releases.
- secrets
-
Protect the tags with a ruleset on
johno/juneforjune-v*: only maintainers and GitHub Actions may create them, and no one may update or delete them. -
Serve the install scripts from
https://june.dev/install.shandhttps://june.dev/install.ps1, as static files that are exactlypackages/june/install/install.shandinstall.ps1frommain(for example, copied intoapps/www/publicin the PR that adds the release key). Until then, people can run them from a checkout or from the public repository's raw URL.
No npm token, R2 bucket or CDN is involved.
Rotate the signing key
- Make a new key (
keygen) and add its public key tokeys.tsand both install scripts alongside the old one. Release a version signed with the old key: every june upgraded to it trusts both. - Switch
JUNE_RELEASE_SIGNING_KEYto the new key and release again. - Once people have had time to upgrade, remove the old key from the trusted lists in a later release.
If the key leaks, do the same, but remove the leaked key in the same release as the new one, make that the latest release, and tell users to reinstall with the install script, since a june that only trusts the leaked key can't tell a forged release from a real one.