-
Notifications
You must be signed in to change notification settings - Fork 0
chore: migrate from semantic-release to release-please #84
Description
Summary
Replace semantic-release (npm) with release-please (GitHub Action) for automated versioning and publishing. This eliminates 5 npm devDependencies (~170 transitive packages) and simplifies the release pipeline.
Background
We are switching to standard semver (major locked to server minor). The custom server:/server-major: commit types are no longer needed. release-please supports standard conventional commits natively with zero local dependencies.
Changes required
1. Add release-please config
Create release-please-config.json:
{
"release-type": "node",
"prerelease": true,
"prerelease-type": "alpha",
"include-component-in-tag": false,
"packages": { ".": {} }
}Create .release-please-manifest.json with the current version.
2. Rewrite release workflow
Replace the current release.yml with a single workflow that:
- Job 1: Generate + test + commit drift (existing logic)
- Job 2 (needs Job 1): Run
googleapis/release-please-action@v4- If releasable commits exist → opens/updates a release PR →
gh pr merge --auto --squash - If merged release PR detected →
release_created=true→ npm publish with OIDC provenance
- If releasable commits exist → opens/updates a release PR →
Requires a PAT or GitHub App token (stored as RELEASE_PAT secret) so that PR merge triggers the next workflow run.
3. Handle stable/* branches
Use target-branch: ${{ github.ref_name }} to support both main (alpha prereleases) and stable/* (stable releases). On stable/* branches, set "prerelease": false in the config (or override via branch-specific config).
4. Remove old release tooling
- Delete
release.config.cjs - Delete
scripts/next-version.mjs - Remove from
package.jsondevDependencies:semantic-release@semantic-release/changelog@semantic-release/exec@semantic-release/git
- Optionally remove
commitlint.config.cjs,@commitlint/cli,@commitlint/config-conventional(keep if commit linting is still desired in CI)
5. Keep existing functionality
- CHANGELOG.md generation (built into release-please)
- GitHub Release creation with source tarball
- npm publish with OIDC provenance
- Docs deployment on
main - Spec snapshot archival
Considerations
- PAT requirement:
GITHUB_TOKENevents don't trigger workflows. A fine-grained PAT or GitHub App token (scoped to this repo,contents: write+pull-requests: write) is needed for auto-merge to trigger the publish run. - Latency: Similar to current flow. Push → PR updated (~30s) → CI → auto-merge → publish.
- Generated code drift: Must be committed before release-please runs. Keep drift commit in Job 1, release-please in Job 2.
- Issue success comments: Current
@semantic-release/githubleaves comments on referenced issues. This feature is lost (minor).