Releases are fully automated by Changesets
and the official Changesets GitHub Action.
Cutting a release is done by merging a PR — there are no local commands to
run and no direct pushes to main.
- Open a PR against
mainwith your change. - Run
yarn changesetand commit the generated.changeset/*.mdfile. - Get the PR reviewed and merged.
That's it. Don't bump versions, don't edit CHANGELOG.md, and don't create
tags. The Release workflow takes care of all
of that.
After any PR carrying a changeset lands on main, the Release workflow opens
(or updates) a single PR titled chore: version packages. This PR is the
release control panel — it accumulates all unreleased changesets and contains
a preview of:
- the bumped
package.jsonversion - the appended
CHANGELOG.mdentries - the regenerated
public/v0.X.jsonJSON schema
Whenever you are ready to publish, merge this PR. On merge, the workflow will:
- Publish the new version to NPM (
npm publishontypesync-cli) - Create a GitHub Release with the matching
vX.Y.Ztag and changelog body - Deploy the regenerated JSON schema to Firebase Hosting (
prod)
If the chore: version packages PR doesn't exist, no changesets have landed
since the last release. Merge any PR with a changeset to materialize one.
To hold a release, just don't merge the PR — new feature merges will keep
adding to it. To cancel a pending release, close the PR; the changesets
remain on main and the next push will reopen it.
Configure under Settings → Secrets and variables → Actions:
| Secret | Purpose |
|---|---|
NPM_TOKEN |
NPM automation token with publish access to typesync-cli |
HOSTING_SERVICE_ACCOUNT_BASE64_PROD |
Base64-encoded GCP service account JSON with Firebase Hosting permission |
Under Settings → Actions → General, make sure the following are enabled:
- Workflow permissions: "Read and write permissions"
- "Allow GitHub Actions to create and approve pull requests"
The release workflow uses the built-in GITHUB_TOKEN to open the
chore: version packages PR; without these settings the action cannot create
or update it.
Now that nothing legitimately needs to push directly to main, enable branch
protection on main:
- Require a pull request before merging
- Require the CI workflow (
lint,test,build,integration-test) to pass - Disallow force-pushes