main- Production-ready code. Only receives merges fromrelease/*andhotfix/*branches.develop- Integration branch for features. Latest development changes.
feature/*- New features- Branch from:
develop - Merge into:
develop - Example:
feature/add-uuid-builder
- Branch from:
release/*- Release preparation- Branch from:
develop - Merge into:
main(auto-merges back todevelop) - Example:
release/v1.2.0
- Branch from:
hotfix/*- Emergency production fixes- Branch from:
main - Merge into:
main(auto-merges back todevelop) - Example:
hotfix/v1.0.1
- Branch from:
git checkout develop
git pull origin develop
git checkout -b feature/add-uuid-builder
# Work on feature
git add .
git commit -m "feat: add UUID builder"
git push origin feature/add-uuid-builder
# Create PR to developOption 1: GitHub Actions UI (Recommended)
- Go to Actions → "Create Release"
- Click "Run workflow"
- Select release type (patch/minor/major) or enter custom version
- Click "Run workflow"
- Review and merge the auto-created PR
- Release publishes automatically to NPM
Option 2: Manual
git checkout develop
git pull origin develop
git checkout -b release/v1.1.0
npm version minor # or major, patch
git push origin release/v1.1.0
# Create PR to maingit checkout main
git pull origin main
git checkout -b hotfix/v1.0.1
# Fix the bug
git commit -m "fix: critical issue"
npm version patch
git push origin hotfix/v1.0.1
# Create PR to main
# After merge → auto-publish to NPMTriggers: Push to develop, feature/*, release/*, hotfix/*
Actions:
- Lint code (ESLint)
- Check formatting (Prettier)
- Run tests with coverage
- Build package
- Upload coverage to Codecov
- Test package installation
Triggers: Push/merge to main
Actions:
- Run full validation
- Extract version from package.json
- Create Git tag
- Generate changelog
- Create GitHub Release
- Publish to NPM with provenance
Triggers: Push to main
Actions:
- Auto-merge
main→develop - Create PR if conflicts occur
Triggers: Manual via GitHub Actions UI
Inputs:
- Version (for custom releases)
- Release type (patch/minor/major/custom)
- Source branch (default: develop)
Actions:
- Create release branch
- Bump version in package.json
- Auto-create PR to main
Follow Conventional Commits:
<type>: <description>
# Types:
feat: New feature
fix: Bug fix
docs: Documentation
test: Tests
refactor: Code refactoring
chore: Maintenance
# Examples:
git commit -m "feat: add UUID builder"
git commit -m "fix: correct string length"
git commit -m "docs: update README"- MAJOR (1.0.0 → 2.0.0): Breaking changes
- MINOR (1.0.0 → 1.1.0): New features (backward compatible)
- PATCH (1.0.0 → 1.0.1): Bug fixes
npm version major # Breaking changes
npm version minor # New features
npm version patch # Bug fixes| Task | Command |
|---|---|
| Start feature | git checkout -b feature/name develop |
| Create release | GitHub Actions → "Create Release" workflow |
| Create hotfix | git checkout -b hotfix/vX.X.X main |
| Run tests | yarn validate |
Configure in Settings → Secrets and variables → Actions:
-
NPM_TOKEN(required) - NPM automation token for publishing- Get from: https://www.npmjs.com/settings/YOUR_USERNAME/tokens
- Type: Automation
- Permissions: Read and Publish
-
CODECOV_TOKEN(optional) - Code coverage reporting- Get from: https://codecov.io/
main branch:
- Require PR reviews (1+)
- Require status checks to pass
- No force pushes
develop branch:
- Require PR reviews (1+)
- Require status checks to pass