Skip to content

chore: migrate from semantic-release to release-please #84

@jwulf

Description

@jwulf

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:

  1. Job 1: Generate + test + commit drift (existing logic)
  2. 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

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.json devDependencies:
    • 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_TOKEN events 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/github leaves comments on referenced issues. This feature is lost (minor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions