This document describes the automated release process for opencode-toolbox.
┌──────────────────────────────────────────────────────────────────────────────┐
│ RELEASE AUTOMATION FLOW │
├──────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────────────┐ │
│ │ 1. TRIGGER │ │ 2. REVIEW │ │ 3. AUTO-PUBLISH │ │
│ │ │ │ │ │ (on PR merge) │ │
│ │ Manual dispatch │───▶│ Release PR │───▶│ │ │
│ │ via GitHub UI │ │ created │ │ • Create git tag │ │
│ │ │ │ │ │ • GitHub release │ │
│ │ Inputs: │ │ Branch: │ │ • npm publish │ │
│ │ - version type │ │ release-vX.Y.Z │ │ │ │
│ │ - custom ver │ │ │ │ │ │
│ └─────────────────┘ └──────────────────┘ └─────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
-
npm OIDC Trusted Publisher: Configured via npm → Package Settings → Trusted Publishers
- Repository:
assagman/opencode-toolbox - Workflow:
release-publish.yml - Environment:
publish - No secrets required - uses OpenID Connect for secure, token-less publishing
- Repository:
-
GitHub Environment: Create environment
publishin repo settings- Go to Settings → Environments → New environment →
publish
- Go to Settings → Environments → New environment →
-
GitHub Labels: Ensure these labels exist:
release- Triggers the publish workflow on PR mergeautomated- Optional, for tracking automated PRs
- Go to Actions → Create Release PR
- Click Run workflow
- Select options:
| Option | Description |
|---|---|
patch |
Bug fixes (0.0.X) |
minor |
New features, backward compatible (0.X.0) |
major |
Breaking changes (X.0.0) |
auto |
Analyze commits to determine version bump |
| Custom version | Override with specific version (e.g., 2.0.0) |
- Click Run workflow
The workflow automatically:
- Creates branch
release-vX.Y.Zfrom latestmain - Updates
package.jsonversion - Updates
CHANGELOG.mdwith categorized commits - Creates a PR with the
releaselabel
Review the PR:
- Verify version bump is correct
- Review and edit CHANGELOG if needed
- Ensure all CI checks pass
When the PR is merged, the publish workflow automatically:
- Creates a signed git tag
vX.Y.Z - Creates a GitHub Release with auto-generated notes
- Publishes to npm with provenance (via OIDC - no tokens needed)
When using auto version type, the workflow analyzes commits since the last tag:
| Commit Pattern | Version Bump |
|---|---|
feat!: or BREAKING CHANGE |
major |
feat: or feature: |
minor |
| All other commits | patch |
Use Conventional Commits for best results:
feat: add new feature→ minorfix: resolve bug→ patchfeat!: breaking change→ majorchore: update deps→ patch
If automation fails, follow this manual process:
git checkout main
git pull origin main
git checkout -b release-vX.Y.Znpm version X.Y.Z --no-git-tag-versionAdd a new section:
## [X.Y.Z] - YYYY-MM-DD
### Added
- New features
### Fixed
- Bug fixesgit add package.json CHANGELOG.md
git commit -m "chore(release): prepare vX.Y.Z"
git push -u origin release-vX.Y.Zgh pr create --title "Release vX.Y.Z" --label "release" --base maingit checkout main
git pull
git tag -s -m "Release vX.Y.Z" vX.Y.Z
git push --tags
gh release create vX.Y.Z --title "vX.Y.Z" --generate-notes
npm publishAfter release, verify:
| Check | URL |
|---|---|
| npm package | https://www.npmjs.com/package/opencode-toolbox |
| GitHub Release | https://github.com/assagman/opencode-toolbox/releases |
| Git tags | git tag -l |
- Verify
publishenvironment exists in GitHub repo settings - Check OIDC trusted publisher config matches workflow file name
- Ensure
id-token: writepermission is set in workflow - Verify package name is available on npm
- Verify PR has the
releaselabel - Check PR was actually merged (not just closed)
- Review workflow run logs in Actions tab
- If tag already exists, the workflow skips tag creation
- Do not delete existing tags - create a new patch version instead (e.g.,
v1.0.1ifv1.0.0had issues) - For problematic releases, deprecate the npm version:
npm deprecate opencode-toolbox@X.Y.Z "Reason for deprecation"
| File | Purpose |
|---|---|
.github/workflows/release-pr.yml |
Creates release PR with version bump |
.github/workflows/release-publish.yml |
Publishes on PR merge |