CapabilityKit publishes two public npm packages:
@capabilitykit/core@capabilitykit/cli
The GitHub Actions publish workflow publishes @capabilitykit/core first because @capabilitykit/cli depends on it.
Runs automatically when a tag matching v* is pushed.
- Steps:
npm ci->test->build->capabilitykit validate->capabilitykit compile->publint->attw-> publish both workspaces - Publishes
@capabilitykit/corefirst, then@capabilitykit/cli - Uses npm trusted publishing with GitHub Actions OIDC
Configure trusted publishing on npmjs.com for both packages before relying on the workflow:
- Open each package on npmjs.com.
- Go to package settings, then Trusted Publisher.
- Add a GitHub Actions trusted publisher with:
- Organization/user:
FocusedObjective - Repository:
capabilitykit - Workflow filename:
publish.yml
- Organization/user:
The workflow has id-token: write, which is required for OIDC trusted publishing. Do not add a long-lived NODE_AUTH_TOKEN unless you intentionally choose token-based publishing instead.
-
Make sure you are on
mainwith a clean working tree.npm run release:prepchecks this before changing files and exits if Git reports pending changes. -
Prepare the release:
npm run release:prep -- patchReplace
patchwithminor,major, or an exact version like0.2.0when appropriate. This updates both workspace package versions, updates the CLI dependency on@capabilitykit/core, updatespackage-lock.json, runsnpm run verify, and runs dry-run packs for both published packages.The script then asks for one confirmation before it stages the release files, commits them, creates the version tag, and pushes
mainwith tags. Press Enter or answernto stop after preparing the files.To only update files and skip the slower checks:
npm run release:prep:files -- patchTo pass other release-prep flags through npm, put them after a second
--. For example:npm run release:prep -- patch -- --allow-dirty. Use that only when you intentionally want to prepare a release with other pending changes in the working tree. -
Monitor the run at:
https://github.com/FocusedObjective/capabilitykit/actions
If you need to run the verification commands by hand, use:
npm run verify
npm pack --workspace @capabilitykit/core --dry-run
npm pack --workspace @capabilitykit/cli --dry-runRegistry metadata can lag for a few minutes. After publishing, check:
npm view @capabilitykit/core version
npm view @capabilitykit/cli version
npx @capabilitykit/cli --versionIf npm view returns 404 immediately after a successful publish, wait and retry. Also confirm npm sees the packages under the org:
npm access list packages @capabilitykit
npm dist-tag ls @capabilitykit/core
npm dist-tag ls @capabilitykit/cliDo not run npm publish locally for normal releases. The Action handles publishing.
Published npm versions are immutable. If a package version has already been published, fixes require a new version number.
Do not publish the root package. The root package.json is private and only coordinates the workspace.