Publishing is handled automatically via GitHub Actions. When you create a GitHub Release, the workflow builds the package and publishes it to npm.
git add .
git commit -m "feat: add new feature"
git pushChoose the appropriate version bump based on the type of change:
npm version patch # Bug fixes (1.0.0 -> 1.0.1)
npm version minor # New features (1.0.0 -> 1.1.0)
npm version major # Breaking changes (1.0.0 -> 2.0.0)This updates package.json and creates a git tag automatically.
git push && git push --tags- Go to https://github.com/betomoedano/snapai/releases/new
- Select the tag you just pushed (e.g.
v1.1.0) - Add a title and release notes
- For pre-releases (beta), check the "Set as a pre-release" box — this publishes to the
betadist-tag instead oflatest - Click "Publish release"
The GitHub Actions workflow will automatically build and publish the package to npm.
# Check the published version
npm view snapai version
# Test it
npx snapai@latest --helpUse beta releases to test changes before promoting them to latest.
# From a stable version (e.g. 1.1.0 -> 1.2.0-beta.0)
npm version preminor --preid beta
# For subsequent beta iterations (e.g. 1.2.0-beta.0 -> 1.2.0-beta.1)
npm version prerelease --preid betagit push && git push --tags- Go to https://github.com/betomoedano/snapai/releases/new
- Select the beta tag you just pushed (e.g.
v1.2.0-beta.0) - Add a title and release notes
- Check the "Set as a pre-release" box — this is what tells the workflow to publish under the
betadist-tag - Click "Publish release"
# Check the beta version
npm view snapai dist-tags
# Test it (users must explicitly opt in to beta)
npx snapai@beta --helpOnce the beta is ready for general release:
# Bump to the stable version (e.g. 1.2.0-beta.3 -> 1.2.0)
npm version minor
# Push and create a regular (non-pre-release) GitHub Release
git push && git push --tagsThen create a new GitHub Release without the pre-release checkbox.
You can also trigger a publish manually from the Actions tab without creating a release:
- Go to https://github.com/betomoedano/snapai/actions/workflows/publish.yml
- Click "Run workflow"
- Optionally set a dist-tag (defaults to
latest) - Click "Run workflow"
Before bumping the version, it's a good idea to verify everything works locally:
# Build and test
pnpm run build
./bin/dev.js --help
./bin/dev.js config --show
# Full production build
pnpm run prepare-publish
node bundle/snapai.js --help
# Preview package contents
npm pack --dry-run# Version already exists on npm
npm version patch # Bump again and re-publish
# Test before publishing
npm pack --dry-run
# Check workflow logs
# Go to https://github.com/betomoedano/snapai/actions- NPM Stats: https://www.npmjs.com/package/snapai
- Check versions:
npm view snapai versions --json - Workflow runs: https://github.com/betomoedano/snapai/actions
- npm publishing uses GitHub Actions trusted publishing with OIDC; no long-lived
NPM_TOKENis required - Users provide their own OpenAI API keys
- No sensitive data is collected or stored