Release the CLI
The Apiome CLI (apiome-cli/, npm name @apiome/cli) is versioned with
changesets. Nobody edits its version by hand: each pull
request describes its change in a small changeset file, a maintainer turns the pending
changesets into a version bump and a changelog entry with one command, and the release itself is
published on GitHub.
your pull request ──merge──▶ Release: apiome-cli vX.Y.Z ──merge──▶ GitHub release, tag cli-vX.Y.Z
(adds a changeset) (bumps version, CHANGELOG)
Add a changeset to your pull request
-
In
apiome-cli/, run:npx changeset -
Pick @apiome/cli, then the bump:
Bump When patchA fix that changes no command, option or output format. minorA new command, option or output field; anything users can now do that they could not. majorA removed or renamed command or option, a changed exit code, or output scripts rely on. -
Write one or two sentences for the changelog — what changed for someone running
apiome. -
Commit the
.changeset/<random-name>.mdfile it writes with the rest of your change.
The file looks like this, and you can edit it until the pull request merges:
---
"@apiome/cli": minor
---
`apiome tags list` takes `--columns` to pick the fields it prints.
Several pull requests can each add a changeset; they are released together, at the highest bump among them.
The changeset check
The apiome-cli changeset / Changeset present check runs on every pull request. It passes when:
- nothing under
apiome-cli/changed; - a new or edited
.changeset/*.mdfile releases@apiome/cli(an empty changeset or one for another package does not count); or - the pull request has the
no-cli-releaselabel — use it for docs-only or test-only changes that should not produce a release.
When it fails, the message says what to do: run npx changeset or add the label. Adding or
removing the label re-runs the check.
The release pull request
When you want to ship the changesets that have merged to main, open the release pull request
yourself — no workflow opens it for you:
-
From an up-to-date
main, create a branch whose name starts withchangeset-release/, for examplechangeset-release/v0.143.0. The changeset check passes such a branch without a changeset of its own. -
At the repository root, run:
yarn workspace @apiome/cli release:versionIt:
- sets the new version in
apiome-cli/package.json,apiome-cli/pyproject.tomlandapiome-cli/uv.lock, soapiome --versionreports it; - adds the changesets' notes to
apiome-cli/CHANGELOG.mdunder the new version; and - deletes the changeset files it used.
- sets the new version in
-
Commit the result, open a pull request titled Release: apiome-cli vX.Y.Z and merge it once its checks pass.
The GitHub release
After the release pull request merges, publish the release on GitHub:
- Open Releases → Draft a new release in the repository.
- Under Choose a tag, type
cli-vX.Y.Z— the version now inapiome-cli/package.json— and pick Create new tag on publish. Keep the target asmain. - Title it apiome-cli vX.Y.Z and paste that version's section of
apiome-cli/CHANGELOG.mdas the description. - For a release candidate, tick Set as a pre-release.
- Select Publish release. GitHub creates the tag.
A released version can be installed straight from its tag:
curl -fsSL https://get.apiome.dev | sh -s -- --version cli-v0.142.0
Pre-releases
To publish release candidates before a stable version:
-
In
apiome-cli/, enter pre-release mode and commit the.changeset/pre.jsonit writes:npx changeset pre enter rc -
Merge pull requests with changesets as usual.
release:versionnow producesX.Y.Z-rc.0, thenX.Y.Z-rc.1, and so on; tag each GitHub releasecli-vX.Y.Z-rc.N. Inpyproject.tomlthe same version is written the Python way,X.Y.Zrc0. -
When the candidate is good, leave pre-release mode and commit the change:
npx changeset pre exitThe next
release:versionrun produces the stableX.Y.Z.
Use rc, beta or alpha as the pre-release name; Python versions have no spelling for others.
Troubleshooting
| Problem | Fix |
|---|---|
| The changeset check fails on a docs-only change. | Add the no-cli-release label. |
npx changeset does not list @apiome/cli. | Run yarn install at the repository root first. |
release:version changes nothing. | No changeset is pending, or none names "@apiome/cli". Run npx changeset status in apiome-cli/. |
| The changeset check fails on the release pull request. | Its branch name must start with changeset-release/. |
release:version fails with "no PEP 440 form". | Pre-release mode uses a name other than rc, beta or alpha; run npx changeset pre exit and enter again with rc. |