This directory contains GitHub Actions workflows for automated CI/CD.
- Trigger: Pull requests and pushes to main branch
- Purpose: Run tests, build checks, and bundle size analysis
- Matrix: Tests on Node.js 16, 18, and 20
- Trigger: Pushes to main branch (with source code changes) or manual dispatch
- Purpose: Automatically version, release, and publish to NPM
- Features:
- Smart version bumping based on commit messages (conventional commits)
- Automatic changelog generation
- GitHub release creation
- NPM publishing
- Trigger: Manual workflow dispatch only
- Purpose: Manual control over releases with custom version bump and notes
- Use case: When you need precise control over release timing and content
Create an NPM access token and add it as a repository secret:
- Go to npmjs.com → Account → Access Tokens
- Create a new "Automation" token
- Add it to GitHub repository secrets as
NPM_TOKEN
Ensure the following repository settings:
- Actions have read/write permissions to contents
- Allow GitHub Actions to create and approve pull requests (if needed)
- Major: Commit messages containing "BREAKING CHANGE" or "feat!"
- Minor: Commit messages starting with "feat"
- Patch: All other changes
- Choose version bump type when triggering the workflow
- Add custom release notes
- Make changes to source code
- Commit with conventional commit messages:
feat: add new feature
(minor bump)fix: resolve bug
(patch bump)feat!: breaking change
(major bump)
- Push to main branch
- Workflow automatically handles the rest
- Go to Actions tab in GitHub
- Select "Manual Release" workflow
- Click "Run workflow"
- Choose version bump type and add notes
- Trigger the workflow
# Patch version bump
git commit -m "fix: resolve face detection issue"
git commit -m "docs: update README"
git commit -m "chore: update dependencies"
# Minor version bump
git commit -m "feat: add auto-capture functionality"
git commit -m "feat: improve performance with throttling"
# Major version bump
git commit -m "feat!: change API interface"
git commit -m "feat: add breaking change
BREAKING CHANGE: The face detection API has changed."
- Check that
NPM_TOKEN
secret is set correctly - Verify the package name is available or you have publishing rights
- Ensure the version doesn't already exist on NPM
- Check that the repository has write permissions for Actions
- Verify Git configuration in the workflow
- Check the build logs in the Actions tab
- Ensure all dependencies are properly listed in package.json
- Verify the build process works locally