Publishing¶
Releases are published to GitHub Packages as @subscribed-aps/subscribed-cli. The package is private (access: restricted) and can only be installed by users with a GitHub token that has read:packages access to the subscribed-aps org.
Prerequisites¶
A GitHub personal access token with the write:packages scope, added to your ~/.npmrc:
@subscribed-aps:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
Steps¶
main only changes through pull requests, so the version bump goes through a PR too. Publishing and tagging happen afterwards, from main.
- Bump the version in a PR. On a new branch from
main, pick the bump following semver: patch(0.1.x) — bug fixesminor(0.x.0) — new commands or features, backwards compatiblemajor(x.0.0) — breaking changes
This updates the version in both package.json and package-lock.json. Commit both (e.g. chore: bump version to 0.1.5), open a PR and merge it.
- Publish from
mainonce the PR is merged:
The prepare script runs npm run build first, so dist/ is always current.
- Tag the release on the commit you published from, so the tag matches the published package:
git tag "v$(node -p 'require("./package.json").version')"
git push origin "v$(node -p 'require("./package.json").version')"
- Verify the new version appears at
https://github.com/orgs/subscribed-aps/packages?repo_name=tools-package-subscribed-cli, or:
Notes¶
- Never publish from a feature branch — always publish from
mainafter the PR is merged. - Tags are lightweight and named
v<version>(v0.1.4,v0.1.5, ...). Without--no-git-tag-version,npm versionwould create the tag on the branch commit instead of the commit that was published.