This repository uses GitHub Actions to automatically publish the ngx-material-drawer library to npm.
- Trigger: Pushing version tags (e.g.,
v2.1.0) or manual dispatch - Purpose: Manual control over when to publish
- Features:
- Runs tests and linting
- Builds the library
- Publishes to npm
- Creates GitHub release
- Trigger: Pushes to main/master branch
- Purpose: Automated semantic versioning and publishing
- Features:
- Automated version bumping
- Changelog generation
- Automatic npm publishing
- GitHub release creation
- Go to npmjs.com and login
- Go to your profile β Access Tokens
- Create a new token with "Automation" type
- Copy the token
- In your GitHub repo: Settings β Secrets and variables β Actions
- Add new secret:
NPM_SECRETwith the npm token value
GITHUB_TOKENis automatically provided by GitHub Actions- No manual setup required
For semantic versioning to work, use conventional commit messages:
feat: add new feature
fix: fix a bug
docs: update documentation
style: formatting changes
refactor: code refactoring
test: add tests
chore: maintenance tasks
feat: add responsive grid systemβ Minor version bumpfix: resolve drawer animation issueβ Patch version bumpfeat!: breaking change in APIβ Major version bump
# 1. Update version in projects/ngx-material-drawer/package.json
# 2. Commit changes
git add .
git commit -m "feat: add new dashboard features"
git push
# 3. Create and push a tag
git tag v2.2.0
git push origin v2.2.0# 1. Push to main branch with conventional commits
git add .
git commit -m "feat: add new dashboard features"
git push origin main
# 2. GitHub Actions will automatically:
# - Analyze commits
# - Determine version bump
# - Update package.json
# - Publish to npm
# - Create GitHub release- Go to your GitHub repo
- Click "Actions" tab
- Monitor workflow runs
- Visit npmjs.com/package/ngx-material-drawer
- Verify version and content
- Go to your GitHub repo
- Click "Releases" on the right sidebar
- View release notes and assets
- Check Node.js version compatibility
- Verify all dependencies are installed
- Check for TypeScript compilation errors
- Verify NPM_TOKEN secret is set correctly
- Check if package name is available on npm
- Ensure version number is unique
- Verify commit message format
- Check .releaserc.json configuration
- Ensure semantic-release dependencies are installed
If automated publishing fails:
# Build manually
npm run build:lib
# Publish manually
cd dist/ngx-material-drawer
npm publish --access public