This document explains how to publish this package to NPM automatically when you create a GitHub release.
If you don't have one already:
- Go to https://www.npmjs.com/signup
- Create an account
- Verify your email
- Log in to https://www.npmjs.com
- Click your profile picture → Access Tokens
- Click "Generate New Token" → "Granular Access Token"
- Configure the token:
- Token name:
bible-ko-mcp-github-actions - Expiration: 1 year (or your preference)
- Packages and scopes:
- Select "Read and write"
- For "Packages", select "All packages" or specifically allow
bible-ko-mcp
- Token name:
- Click "Generate Token"
- Copy the token immediately (you won't be able to see it again)
- Go to your GitHub repository: https://github.com/oksure/bible-ko-mcp
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
NPM_TOKEN - Value: Paste the token you copied from NPM
- Click Add secret
Check if the package name is available on NPM:
npm view bible-ko-mcpIf you get "404 Not Found", the name is available. If not, you'll need to:
- Choose a different name in
package.json - Or use a scoped package:
@oksure/bible-ko-mcp
This triggers automatic publishing via GitHub Actions.
-
Update version in package.json:
npm version patch # For bug fixes (0.1.0 → 0.1.1) npm version minor # For new features (0.1.0 → 0.2.0) npm version major # For breaking changes (0.1.0 → 1.0.0)
-
Push the version commit and tag:
git push && git push --tags -
Create a GitHub Release:
- Go to https://github.com/oksure/bible-ko-mcp/releases
- Click "Create a new release"
- Choose the tag you just pushed (e.g.,
v0.1.1) - Title:
v0.1.1(match the tag) - Description: Write release notes (features, fixes, changes)
- Click "Publish release"
-
Wait for GitHub Actions:
- Go to the Actions tab: https://github.com/oksure/bible-ko-mcp/actions
- Watch the "Publish to NPM" workflow run
- If successful, your package is now live on NPM!
If you prefer to publish manually:
# Make sure you're logged in to NPM
npm login
# Verify package.json version is updated
npm version patch # or minor/major
# Run tests and build
npm test
npm run build
# Publish to NPM
npm publish --access publicAfter publishing, verify your package:
-
View on NPM:
-
Test installation:
npm install -g bible-ko-mcp bible-ko-mcp
-
Check version:
npm view bible-ko-mcp version
- Your NPM_TOKEN might be invalid or expired
- Regenerate the token and update the GitHub secret
- Change the name in
package.json - Or use a scoped package:
@oksure/bible-ko-mcp
- Fix the failing tests before publishing
- The
prepublishOnlyscript will prevent publishing if tests fail
- Your NPM token doesn't have write permissions
- Generate a new token with "Read and write" permissions
Follow Semantic Versioning:
-
MAJOR version (1.0.0 → 2.0.0): Breaking changes
- Changed API, removed features, incompatible changes
-
MINOR version (0.1.0 → 0.2.0): New features
- Added new tools, enhanced functionality
- Backward compatible
-
PATCH version (0.1.0 → 0.1.1): Bug fixes
- Fixed bugs, improved parsing
- No new features, backward compatible
Before creating a release:
- All tests pass:
npm test - Build succeeds:
npm run build - README.md is up to date
- CHANGELOG or release notes prepared
- Version bumped in package.json
- Git tag created and pushed
- GitHub release created with detailed notes
This project has two automated workflows:
-
CI (Continuous Integration) -
.github/workflows/ci.yml- Runs on every push and pull request
- Tests on Node.js 18 and 20
- Ensures tests pass and build succeeds
-
Publish -
.github/workflows/npm-publish.yml- Runs when you create a GitHub release
- Runs tests, builds, and publishes to NPM
- Uses provenance for supply chain security
For the very first publication (v0.1.0):
# Make sure you're ready
npm test
npm run build
# Login to NPM (if not already)
npm login
# Publish for the first time
npm publish --access public
# After successful publication, set up the GitHub workflow
# for future automated releasesIf you encounter issues:
- Check GitHub Actions logs
- Verify NPM token is valid
- Ensure package name is available
- Test locally with
npm packbefore publishing