Each deployment is recorded in docs/release/<tag>/. Release packages are on the private GitHub releases page.
| Tag | Cloudflare version | |
|---|---|---|
| Live | v2.4.1 | b250f55a-54f7-450b-9407-ed4f46ae560d |
| Rollback target | v2.4.0 | 749998b2-fbb6-4c0e-b9ca-252185f7d344 |
Asset requests for .html files redirect to extensionless URLs (html_handling: auto-trailing-slash), so /docs/playing.html is served at /docs/playing. Missing paths get 404.html. _redirects sends the game's old addresses (/Substellar.dc.html, /Substellar.dc) to /play/.
01Rules
- Deploy only when the owner asks. One deploy approval covers the whole release: merge to
main, a new version and tag, the GitHub release, and the Cloudflare deployment of that exact build. - Never deploy code without a new version and tag. Versions follow Semantic Versioning.
- Keep the site public: don't add a Cloudflare Access application for the hostname or change shared Access policies. Keep
workers_devandpreview_urlsoff inwrangler.jsonc. - Keep the previous Cloudflare version as the rollback target.
- Keep credentials and tokens out of the repository.
021. Prepare
On a branch from main:
- Bump the version in
package.json,package-lock.jsonandGAME_VERSIONingame/Substellar.dc.html(npm version <x.y.z> --no-git-tag-versiondoes the first two). - In
site/release-notes.json, make sure the top entry is the new version with its title, summary, groups anddate; add the same version and date at the top ofsite/releases.json(move thePlaylink from the previous release to it). Runnode tools/changelog.cjsto regenerateCHANGELOG.md. npm ci,npm run check, then playtest (see DEVELOPMENT.md).- Merge to
main.
032. Build and package
On main at the commit you will tag, with a clean tree:
npm run build
Note the export digest it prints. Package dist/ as release/Substellar-Canyon-Command-v<version>.zip, copy dist/build-manifest.json to release/, and write release/SHA256SUMS for both files. Copy build-manifest.json to docs/release/v<version>/.
043. Tag and publish the release
git tag -a v<version> -m "Canyon Command v<version>"
git push origin main v<version>
node tools/changelog.cjs --notes v<version> > release/notes.md
gh release create v<version> release/*.zip release/build-manifest.json release/SHA256SUMS --title "Canyon Command v<version>" --notes-file release/notes.md
054. Deploy with Wrangler
npx wrangler whoamimust show the Knot Vector account. If the session has expired, the owner runsnpx wrangler login.- If
wrangler.jsoncgained a Durable Object migration since the live version (v2.4.0 addedRoom),versions uploadrefuses it: runnpx wrangler deploy --message "Canyon Command v<version>; export <digest>"instead, which uploads and promotes in one step, and skip step 3. A version from before a migration cannot be promoted again afterwards, so the first rollback target after v2.4.0 is v2.4.0 itself. Otherwise, stage a version without moving traffic:npx wrangler versions upload --tag v<version> --message "Canyon Command v<version>; export <digest>" - Promote it:
npx wrangler versions deploy <version-id>@100% --message "Deploy v<version>; export <digest>" --yes - Verify anonymously:
/,/play/,/changelog,/docs/and a game asset each return 200,/Substellar.dc.htmlredirects to/play/with no Access redirect, theX-Canyon-Command-Exportheader matches the digest, and the bytes match the release. - Record the deployment in
docs/release/v<version>/cloudflare-deployment.json(version id, previous version id, rollback target, checks, time) and commit it.
06Roll back
Promote the recorded rollback version and repeat the checks in step 4:
npx wrangler versions deploy <rollback-version-id>@100% --message "Roll back to <tag>: <reason>" --yes
Record the rollback in that release's cloudflare-deployment.json.