How to Release DocuMCP
This guide walks you through releasing a new version of DocuMCP to npm and creating a GitHub release.
Prerequisites
Before releasing, ensure you have:
- npm account access: You need publish permissions for the
documcp
package - Clean working directory: All changes must be committed
- Main branch: Must be on the
main
branch - Tests passing: All tests and linting must pass
Authentication Setup
npm Authentication
Login to npm (one-time setup):
npm login
Verify you're logged in:
npm whoami
GitHub Authentication
The release workflow uses GitHub Actions with these secrets:
GITHUB_TOKEN
(automatic)NPM_TOKEN
(must be configured in repository secrets)
Release Methods
Method 1: Using the Release Script (Recommended)
The project includes a release script that handles version bumping and tagging:
# Patch release (0.2.0 → 0.2.1)
./release.sh patch
# Minor release (0.2.0 → 0.3.0)
./release.sh minor
# Major release (0.2.0 → 1.0.0)
./release.sh major
The script will:
- Verify you're on main branch with clean working directory
- Update
package.json
version - Run pre-release checks (
npm run ci
) - Create commit with version changes
- Create annotated git tag
- Push commit and tag to trigger GitHub Actions
Method 2: Manual Release
If you prefer manual control:
-
Update version:
npm version patch # or minor/major
-
Run tests:
npm run ci
-
Commit changes:
git add .
git commit -m "chore(release): bump version to vX.X.X" -
Create and push tag:
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin main
git push origin v1.0.0
GitHub Actions Workflow
Once you push a tag matching v*.*.*
, the release workflow automatically:
1. Pre-release Tests
- Runs full test suite with coverage verification (80% minimum)
- Executes performance benchmarks
- Validates build process
2. Create Release
- Builds the project
- Creates GitHub release with changelog
- Publishes to npm registry
3. Deploy Documentation
- Generates documentation site
- Deploys to GitHub Pages
Monitoring Release Progress
-
GitHub Actions: Monitor the workflow at:
https://github.com/tosin2013/documcp/actions
-
npm package: Verify publication at:
https://www.npmjs.com/package/documcp
-
GitHub release: Check the release page:
https://github.com/tosin2013/documcp/releases
Release Checklist
Before running the release:
- All changes committed and pushed to main
- Tests passing locally (
npm test
) - Linting clean (
npm run lint
) - Build succeeds (
npm run build
) - Documentation updated
- CHANGELOG.md updated (if applicable)
- npm authentication configured
- NPM_TOKEN secret configured in GitHub repository
Troubleshooting
Release Workflow Fails
Test failures: The workflow requires 80% test coverage and all tests to pass.
npm run test:coverage
npm publish fails: Check that NPM_TOKEN
is configured in repository secrets.
Tag already exists: Delete the tag and try again:
git tag -d v1.0.0
git push origin --delete v1.0.0
Version Conflicts
If npm version
fails due to uncommitted changes:
git status
git add .
git commit -m "prepare for release"
Permission Issues
Ensure you have publish permissions for the documcp
package:
npm owner ls documcp
Post-Release Tasks
After a successful release:
- Verify npm package: Install and test the published package
- Update documentation: Ensure docs reflect the new version
- Announce release: Update relevant channels/communities
- Monitor issues: Watch for any post-release issues
Version Strategy
DocuMCP follows Semantic Versioning:
- Patch (0.2.0 → 0.2.1): Bug fixes, minor improvements
- Minor (0.2.0 → 0.3.0): New features, backward compatible
- Major (0.2.0 → 1.0.0): Breaking changes
Given the current production-ready status, consider using minor versions for feature additions and reserve major versions for breaking API changes.