This repository uses semantic-release with enterprise-grade automation for publishing to npm and creating GitHub releases.
- Push commits with conventional commit messages to
main - CI runs quality checks, tests, and builds
- For
feat:(minor) andfix:(patch) commits, semantic-release automatically:- Bumps version in
package.json - Updates
CHANGELOG.md - Publishes to npm
- Creates GitHub release
- Commits version bump back to main
- Bumps version in
- Push commits with
BREAKING CHANGEor similar tomain - System detects major version bump is needed
- Automatically creates a PR for owner review
- PR includes:
- Breaking changes summary
- Review checklist
- Clear approval requirement
- Merge PR to execute the major release
Use Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Minor release (new feature):
feat: add colored output support for error messages
Patch release (bug fix):
fix: resolve timestamp formatting issue in logger
Major release (breaking change):
feat!: redesign logger API with new configuration format
BREAKING CHANGE: Logger configuration now requires an options object instead of separate parameters
- Biome linting and formatting
- TypeScript type checking
- Jest test suite with coverage
- Build verification
- Security audit
- Major versions require manual PR approval
- Automatic duplicate publish prevention
- Version conflict detection
- Rollback capability via git tags
- GitHub Actions status checks
- Release notifications
- Build artifact preservation
- Coverage reporting
Add these in Settings → Secrets and variables → Actions:
-
NPM_TOKEN- npm publish token with access to@calphonse/logger# Generate at https://www.npmjs.com/settings/tokens # Choose "Automation" token type
Enable in Settings → Branches for main:
- Require a pull request before merging
- Require status checks to pass before merging
- Require up-to-date branches before merging
- Required status checks:
quality(CI workflow)security(CI workflow)
-
Create feature branch
git checkout -b feature/your-feature-name
-
Make changes with conventional commits
git commit -m "feat: add new logging level" -
Open PR to main
- CI automatically runs quality checks
- All checks must pass for merge
-
Merge to main
- For minor/patch: Automatic release in ~2-3 minutes
- For major: PR created for review, merge that PR to release
- Check commit message follows conventional format
- Verify
NPM_TOKENsecret is configured - Check GitHub Actions logs for errors
- Ensure commit contains
BREAKING CHANGEin footer - Or use
feat!:orfix!:syntax - Check semantic-release workflow logs
- Verify npm token has publish permissions
- Check if version already exists on npm
- Review package.json
nameandversionfields
Test release locally (dry-run):
pnpm install
pnpm build
npx semantic-release --dry-runRun quality checks:
pnpm qualityEmergency manual release: Use the "Auto Release (manual)" workflow via GitHub Actions UI for emergency releases outside the normal flow.
| Commit Type | Version Bump | Auto-Release |
|---|---|---|
fix: |
Patch | Yes |
feat: |
Minor | Yes |
feat!: or BREAKING CHANGE |
Major | Creates PR |
docs:, style:, test: |
None | No |
Remember: Every commit to main is a potential release. Use descriptive, conventional commit messages!