Skip to content

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.

  1. Bump the version in a PR. On a new branch from main, pick the bump following semver:
  2. patch (0.1.x) — bug fixes
  3. minor (0.x.0) — new commands or features, backwards compatible
  4. major (x.0.0) — breaking changes
npm version patch --no-git-tag-version   # or minor / major; no commit or tag

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.

  1. Publish from main once the PR is merged:
git checkout main && git pull
npm publish

The prepare script runs npm run build first, so dist/ is always current.

  1. 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')"
  1. Verify the new version appears at https://github.com/orgs/subscribed-aps/packages?repo_name=tools-package-subscribed-cli, or:
npm view @subscribed-aps/subscribed-cli version --registry=https://npm.pkg.github.com

Notes

  • Never publish from a feature branch — always publish from main after the PR is merged.
  • Tags are lightweight and named v<version> (v0.1.4, v0.1.5, ...). Without --no-git-tag-version, npm version would create the tag on the branch commit instead of the commit that was published.