This document describes the release process for project maintainers. External contributors should refer to CONTRIBUTING.md.
This project uses a dual-branch workflow with automated releases:
dev- Integration branch for maintainer development and testingmain- Stable branch for releases (also accepts external contributor PRs)- Release Please - Automates versioning, changelog, and npm publishing
All maintainer features are developed and integrated on dev:
git checkout dev
git checkout -b feature/your-feature-name
# ... make changes ...
gh pr create --base dev --head feature/your-feature-nameAfter PR is merged:
- Test integrated changes
- Verify builds:
npm run build - Verify types:
npm run typecheck
When dev has changes ready for release:
gh pr create \
--base main \
--head dev \
--title "chore: release v0.x.x - brief description" \
--body "Promotes integrated changes from dev to main:
- feat: feature description (#PR)
- fix: bug fix description (#PR)
- docs: documentation updates
[Include BREAKING CHANGE note if applicable]
After merge, Release Please will handle versioning and publishing."Review checklist before creating PR:
- All features tested on
dev - Build passes:
npm run build - Types pass:
npm run typecheck - CHANGELOG entries look correct
- Breaking changes are clearly documented
Review and merge the promotion PR. This triggers Release Please.
Release Please automatically:
- Analyzes commits since last release
- Determines version bump based on conventional commits
- Updates
package.jsonversion - Updates
CHANGELOG.md - Updates
.release-please-manifest.json - Creates a release PR titled
chore(main): release x.x.x
Do not edit the Release Please PR - it's auto-generated.
When you merge the Release Please PR, it automatically:
- Creates git tag (e.g.,
v0.1.0) - Creates GitHub release with changelog
- Publishes to npm with provenance
- Triggers the publish workflow
After publish:
- Verify on npm: https://www.npmjs.com/package/opencode-sessions
- Test installation:
npm install opencode-sessions@latest
After release, sync dev to include version bumps:
git checkout dev
git pull origin dev
git merge main
git push origin devThis project follows Semantic Versioning with Conventional Commits.
While version is 0.x.x, breaking changes bump minor version (configured in release-please-config.json):
| Commit Type | Example | Version Bump | Description |
|---|---|---|---|
feat: |
feat: add session modes |
0.0.4 → 0.1.0 | New feature (minor) |
fix: |
fix: resolve path issue |
0.0.4 → 0.0.5 | Bug fix (patch) |
feat!: |
feat!: change API |
0.0.4 → 0.1.0 | Breaking change (minor) |
BREAKING CHANGE: |
In commit body | 0.0.4 → 0.1.0 | Breaking change (minor) |
docs:, chore: |
Documentation/maintenance | No bump | No release |
After reaching 1.0.0, breaking changes will bump major version:
| Commit Type | Version Bump |
|---|---|
feat!: |
1.0.0 → 2.0.0 |
feat: |
1.0.0 → 1.1.0 |
fix: |
1.0.0 → 1.0.1 |
External contributors create PRs directly to main. When merged:
- If it's a
feat:orfix:, Release Please will include it in the next release - Maintainer can immediately merge Release Please PR for quick release
- Or wait to batch with other changes
No action needed - Release Please handles it automatically.
Cause: No feat: or fix: commits since last release.
Solution: Ensure commits use conventional commit format.
Cause: Commit type doesn't match change.
Solution:
- Close Release Please PR
- Fix commit message on
mainbranch - Release Please will recreate PR with correct version
Cause: npm authentication issue.
Solution:
- Check
NPM_TOKENsecret in GitHub settings - Verify token has publish permissions
- Re-run failed workflow
Not recommended, but if needed:
# On main branch
npm version patch # or minor, major
git push --follow-tagsRelease Please will detect the manual bump and adjust.
If you need to hotfix main directly (skipping dev):
git checkout main
git checkout -b hotfix/critical-fix
# ... make fix ...
gh pr create --base main --head hotfix/critical-fixAfter merge:
- Release Please creates release PR
- Merge to publish
- Don't forget to backport to
dev:git checkout dev git cherry-pick <hotfix-commit-sha> git push origin dev
Before promoting dev → main:
- All PRs on
devare tested - Build passes:
npm run build - Types pass:
npm run typecheck - Breaking changes documented
- README updated if needed
- Examples tested (if applicable)
After merging Release Please PR:
- Verify npm package: https://www.npmjs.com/package/opencode-sessions
- Test installation:
npm install opencode-sessions@latest - Verify GitHub release created
- Sync
devwithmain
If you're unsure about the release process:
- Review recent releases: https://github.com/malhashemi/opencode-sessions/releases
- Check Release Please docs: https://github.com/googleapis/release-please
- Open a discussion: https://github.com/malhashemi/opencode-sessions/discussions