This project uses a two-step automated release system. The Release workflow prepares a release PR from dev, and the Publish workflow publishes after that PR is merged to main.
- Merge ready feature PRs into
dev. - Run the GitHub Actions
Releaseworkflow. - Keep
source_branchasdevunless intentionally releasing from another branch. - Choose
patch,minor, ormajor. - Review and merge the generated
release/vX.Y.Z -> mainPR. - The
Publishworkflow runs automatically after the release PR changespackage.jsononmain. - After publishing, sync
mainback intodevso the version bump is carried forward.
feature branches -> dev -> release/vX.Y.Z -> main -> publish
Release branches are short-lived per-version branches. There is no long-lived release branch.
The Release workflow (.github/workflows/release.yml) is manually triggered. It checks out dev by default and runs:
bun scripts/release.ts prepare <patch|minor|major>It will:
- Create
release/vX.Y.Zfrom the selected source branch. - Bump
package.jsontoX.Y.Z. - Run
npm run build. - Commit the version bump.
- Push the release branch.
- Open a PR from
release/vX.Y.Ztomain.
The Publish workflow (.github/workflows/publish.yml) runs on manual dispatch or when package.json changes on main. It runs:
bun scripts/release.ts publishIt will:
- Run
npm run build. - Create and push the
vX.Y.Zgit tag if it does not already exist. - Create a GitHub release with generated release notes.
- Publish
opencode-models-discovery@X.Y.Zto npm if that version does not already exist.
Local release preparation can still use the same script, but prefer the GitHub Actions workflow for normal releases.
-
GitHub CLI (
gh) authenticated:gh auth login
-
From the intended source branch, run:
bun scripts/release.ts prepare patch- Configure npm trusted publishing for this repository.
- Ensure the Publish workflow has
id-token: writepermission. - Run the workflow:
- Go to: Actions -> Release -> Run workflow
- Select version type (patch/minor/major)
- Keep source branch as
dev - Click "Run workflow"
- patch: Bug fixes, small improvements (0.1.0 -> 0.1.1)
- minor: New features, backwards compatible (0.1.0 -> 0.2.0)
- major: Breaking changes (0.1.0 -> 1.0.0)
If automation fails, complete the same two phases manually.
git switch dev
bun scripts/release.ts prepare patchgit switch main
git pull origin main
bun scripts/release.ts publishCommon causes:
- Trusted Publishing is not configured for this repository.
- The Publish workflow is missing
id-token: write. - The package version already exists on npm.
- The publish step was run outside GitHub Actions without npm credentials.
Ensure GH_TOKEN is available in GitHub Actions, or authenticate GitHub CLI locally:
gh auth loginThe publish script detects existing npm versions and skips npm publish. Bump to a new version if you need another release.
Merge main back into dev after the release PR is merged and published.
The normal CI/CD release path is:
- Go to Actions tab.
- Select
Releaseworkflow. - Click
Run workflow. - Choose version type.
- Keep source branch as
dev. - Merge the generated release PR into
main. - Let the
Publishworkflow publish automatically.
Do not run release preparation from main during normal development releases.