# Release & Publish

Steps to publish this package to npm and enable CI-based publishing.

1) Local validation

```bash
npm install
npm run build
npm pack
# Inspect the tarball to ensure build/ files and bin are included
tar -tf $(ls *.tgz | tail -n1)
```

2) Manual publish (one-time)

```bash
npm login
npm publish --access public
```

3) Automatic publish via GitHub Actions (recommended)

- Create an npm automation token: https://www.npmjs.com/settings/<your-username>/tokens
- Add the token to your GitHub repository secrets as `NPM_TOKEN`.
- Push a semver tag (e.g., `v2.0.3`) to trigger the workflow:

```bash
git tag v2.0.3
git push origin v2.0.3
```

The Action will run `npm ci`, `npm run build` and `npm publish` using the token.

Notes
- Ensure `package.json` `bin` entries point to compiled files (this repo uses `build/src/commands/*.js`).
- `prepare` script runs `npm run build` on `npm publish` or when installing from git.
