Skip to content

Releasing

Claude edited this page Nov 30, 2026 · 7 revisions

Releasing

The live app is whatever is on main: every push to main that passes CI is deployed to GitHub Pages. A release is a version number, a changelog entry and a GitHub release that mark a point on main. Version numbers follow semantic versioning loosely: a minor version per finished milestone, a patch for follow-up fixes.

Work reaches main in two steps: small pull requests into a milestone branch, then one release pull request from that branch into main.

1. One small pull request per issue

Each milestone has its own long-lived branch off main (for 1.32.0, the Project health milestone, it was health). Every issue in the milestone gets its own short branch and its own pull request into that milestone branch:

  • Keep it to the one issue, so it's easy to review.
  • Reference the issue with Refs #123, not a closing keyword: GitHub only acts on closing keywords in pull requests into the default branch, and the issue should stay open until the release ships it.
  • Don't touch CHANGELOG.md; the release pull request writes the whole entry at once.
  • Documentation for the change lands with it: the README, docs/architecture.md (the docs drift test fails without it) and docs/design-notes.md.

CI's test job runs on every pull request whatever its base, so each small pull request passes the same gate as main; see Development and testing.

2. The release pull request

When the milestone's pull requests have all been merged into its branch:

  1. Branch from the milestone branch, e.g. release/1.32.0, and bring it up to date with main if main has moved.

  2. Bump the version without creating a tag:

    npm version 1.32.0 --no-git-tag-version

    This updates package.json and package-lock.json.

  3. Add the entry at the top of CHANGELOG.md, which follows Keep a Changelog, under the empty ## [Unreleased] heading (which stays):

    ## [1.32.0] - 2026-11-14
    
    One paragraph on what this release is about (usually the milestone).
    
    ### Added
    - What it does for the user ([#616](https://github.com/ch-bas/threejs-sims-house-builder/issues/616))
    
    ### Changed
    - …
    
    ### Fixed
    - …

    Write for people using the app: what they'll notice, not how it was done. Link every issue.

    The What's new card shows the newest version's ### Added lines, so keep each one's lead short (110 characters or fewer, or the card cuts it at a word). Since 2.0.0 it also comes in the other languages, from docs/changelog/<lang>.md (de, tr, fr, zh, ja, and since 2.1.0 id, es, pt): add the version there too, with exactly one translated bullet per English ### Added bullet, in the same order. A language without the version shows the English lines.

  4. Commit (Release 1.32.0: bump version, lockfile, and changelog), push, and open the pull request into main.

  5. In its description, list one closing keyword per issue, each on its own line (Closes #616, then Closes #612 on the next line). A comma-separated list closes only the first issue.

  6. Merge it with a merge commit, so the small pull requests' history stays on main as it was reviewed.

3. CI on main: test, then release and deploy

Everything runs in one workflow, .github/workflows/ci.yml, on the ubuntu-24.04 runner image. On a push to main it has three jobs:

  1. test: the same gate as on a pull request (install, audit, typecheck, lint, unit tests, the GitHub Pages build with its post-build steps, the CSP step, the bundle budget report and the smoke test). On main it also uploads out/ as the Pages artifact. The build id is the commit's SHA, so a rebuild of the same commit gives the same files.

  2. release runs only after test passes. It compares the version in package.json with the previous commit's. If the version changed and there's no GitHub release v<version> yet, it creates one, tagged v<version> on that very commit, with notes generated from the merged pull requests. Pushes that don't change the version create nothing, so a later merge can never carry the tag.

  3. deploy also runs only after test passes, and only if that commit is still the head of main. Each commit on main gets its own run, so an older commit's slower run can finish after a newer one's; it then skips its deploy, and the site never steps back to an older build. A deploy in progress is never cancelled; a newer one waits for it.

    Before publishing, the deploy checks the site's address. The Content-Security-Policy only lets scripts load from the site's own _next/ folder at https://<owner>.github.io, so if Pages now serves the site anywhere else (a custom domain, a renamed owner), every script would be blocked. The job asks GitHub for the Pages address and stops with "Site address changed" if its origin doesn't match, leaving the working site in place. In that case, set CSP_SITE_ORIGIN for the build (see scripts/add-csp.mjs) and run it again.

If the release commit fails the gate, land the fix, then run the workflow by hand on main (Actions → CI → Run workflow): a manual run releases from the commit it runs on.

The offline worker and its kill switch

Since 1.37.0 every build ships sw.js, the service worker that lets the app open offline. Visitors keep the version they have until it updates: a reload of a single open tab moves to the new build once its worker has installed, and with several tabs open an older build can keep running, which is why a save stamps its version and an older build asks before saving over a newer one's house.

If a deployed worker ever misbehaves, there's a kill switch for maintainers:

  1. In the repository, Settings → Secrets and variables → Actions → Variables, add a variable SERVICE_WORKER with the value off (or false, or 0).
  2. Run the workflow on main (Actions → CI → Run workflow). CI passes the variable to the build as NEXT_PUBLIC_SERVICE_WORKER, and that build ships a worker that deletes the app's offline caches, unregisters itself and reloads its pages. Browsers fetch sw.js on their own when they check for updates, so this reaches even a page too broken to run its own scripts.
  3. When the fix has landed, delete the variable and deploy again to turn offline support back on.

The worker only ever touches this site's own caches (pc-shell:/threejs-sims-house-builder/:…), never a sibling Pages site's, and never the saved houses.

4. Afterwards

  • Check the releases page for the new release and its notes, and the milestone's issues for "closed by" the release pull request.
  • Open the live app and do a quick smoke test: it loads, a saved house reopens, 3D and 2D both draw. A browser that already has the offline worker keeps the old build until the worker has installed the new one: the page offers Reload once it has ("A new version is ready"); the version shows in the tooltip of View options → Help → New, and the What's new card names it. The card's lines come from the release's Added list in CHANGELOG.md (scripts/whats-new.mjs, at build time), so write those for players: a release with no Added lines shows no card. Browsers holding the previous version's HTML may hit a missing chunk once; the app reloads itself once to pick up the new build.
  • Check offline: with the developer tools' network set to Offline, a reload still opens the editor. CI's smoke test checks the same on the build, but report-only.
  • Close the milestone.
  • Update this wiki: the version on Home, and the pages for what changed.

Notes

  • All workflow actions are pinned to commit SHAs, and every job runs on a pinned runner image (ubuntu-24.04); bump it in a pull request of its own.
  • Dependabot (.github/dependabot.yml) opens one grouped pull request a week for minor and patch npm updates. Major upgrades of React, Next.js, Tailwind and ESLint are held back on purpose. It also checks the workflow actions weekly.
  • A separate workflow, .github/workflows/audit.yml, runs npm audit over the whole lockfile, dev dependencies included, every Monday. It lists every advisory in the run summary and fails on a high or critical one, which notifies the repository's watchers.
  • Don't push a v* tag for a version that hasn't been merged to main. The release job only ever runs on main; a tag already pushed by hand for the bumped version is used as it is.

Clone this wiki locally