This document describes how to release a new version of the @opencode/webhook-plugin package.
- NPM Account: You need an npm account with publish access to the
@opencodescope - GitHub Permissions: You need write access to the repository
- Secrets Configured: Ensure
NPM_TOKENis configured in GitHub repository secrets
Update the version in package.json:
# For a patch release (1.0.0 -> 1.0.1)
npm version patch
# For a minor release (1.0.0 -> 1.1.0)
npm version minor
# For a major release (1.0.0 -> 2.0.0)
npm version majorThis will:
- Update version in
package.json - Create a git commit with the version bump
- Create a git tag (e.g.,
v1.0.1)
# Push the commit
git push
# Push the tag
git push --tags- Go to the Releases page
- Click "Draft a new release"
- Select the tag you just pushed (e.g.,
v1.0.1) - Set the release title (e.g.,
v1.0.1) - Add release notes describing changes
- Click "Publish release"
Once you publish the GitHub release, the automated workflow will:
- ✅ Verify version - Ensures package.json version matches release tag
- ✅ Run quality checks:
- Lint the code
- Run all tests with coverage
- ✅ Build the package:
- Compile TypeScript
- Create npm package
- ✅ Publish to npm:
- Publish with provenance
- Verify package on npm registry
- ✅ Upload release assets:
- Upload npm package tarball
- Upload source archive
- ✅ Create summary - Generate detailed release summary
After the workflow completes:
- Check the npm package page
- Verify the new version is available
- Test installation:
npm install @opencode/webhook-plugin@latest
Follow Semantic Versioning:
- MAJOR (x.0.0): Breaking changes
- MINOR (0.x.0): New features, backwards compatible
- PATCH (0.0.x): Bug fixes, backwards compatible
For beta or alpha releases:
# Create a beta version
npm version prerelease --preid=beta
# Results in: 1.0.1-beta.0
# Create an alpha version
npm version prerelease --preid=alpha
# Results in: 1.0.1-alpha.0Pre-release versions can be published with a tag:
npm publish --tag betaIf the automated workflow fails, you can publish manually:
# Ensure you're logged in
npm login
# Build the project
npm run build
# Publish
npm publish --access publicIf you get a version mismatch error:
- Ensure
package.jsonversion matches the release tag - Tags should be in format
v1.0.0(with 'v' prefix) - Package version should be
1.0.0(without 'v' prefix)
If publishing fails due to authentication:
- Generate a new npm token with publish access
- Update the
NPM_TOKENsecret in GitHub repository settings - Re-run the workflow
You cannot republish the same version. You must:
- Bump the version
- Create a new release
If you need to rollback a release:
# Deprecate the bad version
npm deprecate @opencode/webhook-plugin@1.0.1 "This version has critical bugs, use 1.0.2 instead"
# Publish a new fixed version
npm version patch
# ... follow release stepsNote: You cannot unpublish versions that are older than 24 hours.
# View package info
npm view @opencode/webhook-plugin
# View specific version
npm view @opencode/webhook-plugin@1.0.1
# View all versions
npm view @opencode/webhook-plugin versions- Go to Actions tab
- Select the "Release" workflow
- View logs for the release run
Before releasing:
- All tests pass locally (
npm test) - Linting passes (
npm run lint) - Build succeeds (
npm run build) - CHANGELOG.md is updated (if you maintain one)
- Documentation is up to date
- Version number follows semver
- Release notes are prepared
After releasing:
- Verify package on npm
- Test installation in a fresh project
- Check GitHub release page
- Announce release (if applicable)