Every package in this repository has a semantic version and a CHANGELOG.md, written by Changesets from the changeset each pull request adds. The root CHANGELOG.md collects every release in one place. Decided in ADR 0023.
flowchart TB
PR["Pull request<br/>code + a changeset: which packages, which bump, what changed"] --> Check["checks: check:changesets<br/>every changed package is named; node executables, web client and both images build"]
Check --> Merge["Merge to main<br/>checks pass, production deploys"]
Merge --> Version["release: changeset version<br/>bumps versions, writes CHANGELOG.md files, commits Release vX.Y.Z, tags it"]
Version --> Publish["release: GitHub release vX.Y.Z<br/>executables, web client, checksums, images vX.Y.Z and vX.Y"]
Run bunx changeset in your branch, choose the packages you changed and a bump for each, and describe the change in a sentence or two a user of that package would understand. Commit the file it writes in .changeset/.
- A pull request that ships nothing (documentation, tests, CI, repository tools) adds an empty changeset:
bunx changeset --empty, with a sentence saying what it does. Dependabot's updates are the one exception, because Dependabot cannot write one: they may leave it out when they change no shipped file, and a maintainer adds the changeset when they do. bun run check:changesetsruns the same check as CI: it fails when the pull request adds no changeset, or changes a package's shipped files (anything buttest/,scripts/,*.test.ts,README.mdandCHANGELOG.md) without naming that package. It lists the bumps of seam packages for the reviewer.- Write what changed for the people who use the package, not how: "Recipients can rename a file before saving" rather than "Add nameField".
| Line | Packages | Version | Released as |
|---|---|---|---|
| The product | apps/web, platforms/*, services/* (one version, Changesets' fixed group) |
vX.Y.Z |
Git tag vX.Y.Z, GitHub release with the node executables and web client, container vX.Y.Z and vX.Y |
| Libraries | libraries/*, each on its own |
<package>@X.Y.Z |
Git tag only; other clients build against these |
A library change also bumps the packages that depend on it (a patch, "Updated dependencies"), so the product releases whenever a library it ships changes. tools/* is never versioned.
| Bump | When |
|---|---|
| major | A user of the package must change something: a seam stops accepting what it accepted, a setting or endpoint is removed or renamed, a function's meaning changes. |
| minor | Something new that existing users can ignore: a new optional field, message, endpoint, setting or function, a new parcel version alongside the old ones. |
| patch | Nothing a user can rely on changes: fixes that restore documented behaviour, performance, wording. |
Until the product reaches 1.0.0, a breaking change to the product bumps the minor version, as SemVer allows for 0.x versions; major is kept for the decision to call it 1.0.0. The seam libraries below start at 1.0.0 and follow the table strictly from the start, because other clients depend on them.
A seam is a contract between pieces built and deployed independently: a recipient's browser and a sender's, an old client and a new server, another implementation of the parcel. Their versions carry the most weight, and check:changesets lists their bumps on every pull request.
| Seam | Package | Breaking (major) | Additive (minor) |
|---|---|---|---|
Parcel format (docs/parcel.md) |
@file-transfer/parcel |
Anything that changes the bytes of a frozen format version, or drops reading one. A frozen version is never edited (CLAUDE.md); a change is a new version. | A new parcel version that readers accept alongside the existing ones. |
Room protocol (docs/protocol.md): control messages, unit frames, close codes |
@file-transfer/transport |
Removing or renaming a message or field, making an optional field required, changing a frame or close code's meaning. | A new message or optional field older endpoints ignore (decoders drop unknown keys). |
Server HTTP API (/api/*), operator settings (environment variables, wrangler.jsonc), Durable Object classes and migrations |
@file-transfer/platform-cloudflare (product) |
Removing or renaming an endpoint, response field, setting or Durable Object class; changing a default in a way an operator would notice. | A new endpoint, response field, setting or Durable Object class. |
Releases happen on their own, in two workflows. When checks passes on a push to main and changesets are waiting, release.yml runs changeset version, writes the notes into the root CHANGELOG.md (bun run release:prepare), and pushes Release vX.Y.Z to main with its tags. The push of the vX.Y.Z tag starts publish.yml, which builds and smoke-tests the executables on every platform and both container architectures from that tag, and publishes the GitHub release with the tag's section of CHANGELOG.md (bun run release:notes). Publishing from the tag's own push means no privileged workflow builds a commit it was handed as an input. To publish a tag again, run publish by hand on it. A push with only empty changesets releases nothing; their files go with the next release.
The release commit is pushed by GitHub Actions, so it does not run checks again; it changes only versions and changelogs.
Main accepts changes only through pull requests with passing checks (the protect-main ruleset), and a workflow's own token cannot be exempted, so the release workflow pushes its commit and tags with a deploy key that is on the ruleset's bypass list. The private key is the RELEASE_DEPLOY_KEY secret of the release environment, whose deployment branches are limited to main, so a workflow run for a pull request cannot read it. To set it up, or to replace a key:
# The environment, deployable from main only
gh api -X PUT repos/phibkro/file-transfer/environments/release \
-F 'deployment_branch_policy[protected_branches]=false' -F 'deployment_branch_policy[custom_branch_policies]=true'
gh api -X POST repos/phibkro/file-transfer/environments/release/deployment-branch-policies -f name=main -f type=branch
# The key: public half as a deploy key with write access, private half as the environment's secret
ssh-keygen -t ed25519 -N "" -C "file-transfer release" -f release-key
gh repo deploy-key add release-key.pub --repo phibkro/file-transfer --allow-write --title release
gh secret set RELEASE_DEPLOY_KEY --repo phibkro/file-transfer --env release < release-key && rm release-key release-key.pubThen add the key under Deploy keys in the ruleset's bypass list. gh secret set does not create the environment, which is why it comes first. A release finds no key and stops with an error naming this section. Adding yourself as a required reviewer on the release environment makes every release wait for your approval.