Publishing Guide
This document describes the process for publishing new versions of wiremd to npm.
Prerequisites
Before publishing, ensure you have:
- npm Account: You need an npm account with publish rights for the
wiremdpackage - NPM_TOKEN: A valid npm access token stored as a GitHub secret
- Create token at: https://www.npmjs.com/settings/YOUR_USERNAME/tokens
- Token type: "Automation" (for CI/CD) or "Publish"
- Add as GitHub secret: Settings → Secrets and variables → Actions → New repository secret
- Secret name:
NPM_TOKEN
Pre-Publication Checklist
Before creating a release, verify:
- [ ] All tests pass:
npm test - [ ] Build succeeds:
npm run build - [ ] Type checking passes:
npm run typecheck - [ ] Linting passes:
npm run lint - [ ] Documentation is up to date
- [ ] CHANGELOG.md is updated with release notes
- [ ] Version number follows Semantic Versioning
Release Process
1. Update Version
Update the version in package.json:
bash
# For patch releases (bug fixes)
npm version patch
# For minor releases (new features, backward compatible)
npm version minor
# For major releases (breaking changes)
npm version majorThis will:
- Update version in
package.json - Create a git commit with the version change
- Create a git tag (e.g.,
v0.1.1)
2. Push Changes and Tag
bash
git push origin main
git push origin --tags3. Create GitHub Release
- Go to https://github.com/teezeit/wiremd/releases/new
- Select the tag you just pushed (e.g.,
v0.1.1) - Set release title (e.g.,
v0.1.1) - Add release notes describing:
- New features
- Bug fixes
- Breaking changes (if any)
- Upgrade instructions (if needed)
- Click "Publish release"
4. Automated Publishing
Once you publish the GitHub release:
- The
.github/workflows/publish.ymlworkflow automatically triggers - It will:
- Checkout the code
- Install dependencies
- Run tests
- Build the project
- Publish to npm with provenance
You can monitor the progress at: https://github.com/teezeit/wiremd/actions
5. Verify Publication
After the workflow completes:
- Check npm: https://www.npmjs.com/package/wiremd
- Verify the new version is listed
- Test installation:
npm install wiremd@latest
Manual Publishing (Not Recommended)
If you need to publish manually (use only in emergencies):
bash
# Login to npm
npm login
# Verify you're logged in as the correct user
npm whoami
# Ensure you're on the correct git tag
git checkout v0.1.1
# Build the project
npm run build
# Publish with provenance
npm publish --provenance --access publicTroubleshooting
Publishing Fails
If the GitHub Action fails:
- Check the action logs: https://github.com/teezeit/wiremd/actions
- Common issues:
- Tests failing: Fix tests and create a new release
- Build errors: Fix build issues and create a new release
- NPM_TOKEN expired: Generate new token and update GitHub secret
- Version already exists: Update version number
Version Conflicts
If you accidentally published the wrong version:
- You cannot unpublish versions less than 72 hours old
- Instead, publish a new patch version with fixes
- If absolutely necessary, contact npm support
Permission Issues
If you get permission errors:
- Verify you're a maintainer: https://www.npmjs.com/package/wiremd
- Check your npm token has publish rights
- Ensure
publishConfig.accessis set to"public"in package.json
Package Information
- Package name:
wiremd - npm page: https://www.npmjs.com/package/wiremd
- Repository: https://github.com/teezeit/wiremd
- Registry: npm (public)
- Author: Antti Akonniemi antti@kiskolabs.com
- License: MIT
Post-Publication
After successful publication:
- Announce the release (if significant):
- Update documentation site
- Post on social media/blog (optional)
- Notify users of breaking changes
- Monitor for issues:
- Watch GitHub issues
- Check npm download stats
- Update dependent projects if needed
Version Strategy
Follow Semantic Versioning:
- MAJOR (x.0.0): Breaking changes
- MINOR (0.x.0): New features, backward compatible
- PATCH (0.0.x): Bug fixes, backward compatible
For pre-1.0.0 releases, minor version bumps may include breaking changes.
Security
- Never commit npm tokens to the repository
- Use GitHub secrets for CI/CD tokens
- Use automation tokens for GitHub Actions
- Rotate tokens periodically
- Enable 2FA on your npm account