-
Version Bump: Update version in
package.jsonnpm version patch # for bug fixes npm version minor # for new features npm version major # for breaking changes
-
Create and Push Tag: The
npm versioncommand automatically creates a git taggit push origin main --tags
-
GitHub Actions: The release workflow automatically triggers when a tag is pushed
- Runs tests and builds the package
- Publishes to npm registry
- Creates GitHub release
The release process is fully automated via GitHub Actions when you push a tag starting with v:
NPM_TOKENsecret set in GitHub repository settingsGITHUB_TOKENautomatically provided by GitHub Actions
-
CI/CD Pipeline (
ci.yml): Runs on every push and PR- Tests on Node.js 18.x and 20.x
- Runs linter and tests
- Builds package
- Tests CLI functionality
-
Release Pipeline (
release.yml): Runs on tag push- Builds and tests the package
- Publishes to npm registry
- Creates GitHub release
Before releasing, test the package locally:
# Run tests
npm test
# Build the package
npm run build
# Test CLI functionality
node dist/cli.js --help
# Test packaging (dry run)
npm pack --dry-run
# Test local installation
npm pack
npm install -g refakts-1.0.0.tgz
refakts --help
npm uninstall -g refakts- Create npm account: https://www.npmjs.com/signup
- Generate npm token: https://www.npmjs.com/settings/tokens
- Add token to GitHub: Repository Settings → Secrets →
NPM_TOKEN - Verify package name availability:
npm search refakts
- All tests passing
- Documentation updated
- Version bumped appropriately
- Tag created and pushed
- GitHub Actions completed successfully
- Package published to npm
- GitHub release created
- Test installation from npm registry