Skip to content

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

@jwulf

Description

@jwulf

Summary

Replace semantic-release (npm) with release-please (GitHub Action) for automated versioning and publishing. This eliminates npm devDependencies and simplifies the release pipeline.

Mirrors: camunda/orchestration-cluster-api-js#84

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": "simple",
  "prerelease": true,
  "prerelease-type": "alpha",
  "include-component-in-tag": false,
  "packages": { ".": {} },
  "extra-files": [
    "src/Camunda.Orchestration.Sdk/Camunda.Orchestration.Sdk.csproj"
  ]
}

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=truedotnet pack + dotnet nuget push with OIDC provenance (NuGet/login@v1)

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 commitlint.config.cjs (keep if commit linting is still desired in CI)
  • Remove from package.json devDependencies:
    • semantic-release
    • @semantic-release/changelog
    • @semantic-release/exec
    • @semantic-release/git
    • @commitlint/cli
    • @commitlint/config-conventional
  • Delete package.json and package-lock.json entirely if no npm dependencies remain

5. Keep existing functionality

  • CHANGELOG.md generation (built into release-please)
  • GitHub Release creation with source tarball
  • NuGet publish via dotnet nuget push with OIDC provenance
  • .csproj <Version> tag updates (via extra-files)
  • prepare-release.sh / publish-nuget.sh scripts (adapt as needed)
  • Spec snapshot archival
  • Docs deployment on main

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.
  • Version in .csproj: release-please's extra-files feature can update the <Version> tag in Camunda.Orchestration.Sdk.csproj, replacing what prepare-release.sh currently does via sed.
  • 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