fix: Add release-please for automated releases#216
Conversation
79b460d to
4578782
Compare
Greptile SummaryThis PR introduces automated release tooling for Key changes:
Issues found:
Confidence Score: 4/5
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant GH as GitHub (main branch)
participant RPW as release-please.yml
participant RP as release-please-action
participant RPRR as Release PR
participant RW as release.yml
participant NuGetLogin as NuGet/login (OIDC)
participant NuGet as nuget.org
Dev->>GH: Merge conventional-commit PR (squash)
GH->>RPW: push event (branch: main)
RPW->>RP: Run release-please-action
RP->>RPRR: Create/update Release PR (bump version + CHANGELOG)
Note over RPRR: PR updates .release-please-manifest.json,<br/>WorkOS.net.csproj (VersionPrefix + Version),<br/>CHANGELOG.md
Dev->>GH: Merge Release PR
GH->>RP: push event (branch: main)
RP->>GH: Create GitHub Release + tag (vX.Y.Z)
GH->>RW: release: [published] event
RW->>RW: dotnet pack (Build step)
RW->>NuGetLogin: Exchange OIDC token for temporary API key
NuGetLogin-->>RW: NUGET_API_KEY (short-lived)
RW->>NuGet: dotnet nuget push *.nupkg --api-key $NUGET_API_KEY
NuGet-->>RW: Published (or skipped if duplicate)
Last reviewed commit: 6705a71 |
4578782 to
dae6267
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dae6267 to
eab000b
Compare
|
@greptile review |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile review |
| name: Release Please | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
There was a problem hiding this comment.
Missing concurrency group — parallel runs can corrupt the release PR
Without a concurrency group, rapid successive pushes to main (e.g., two PRs merged in quick succession) will trigger parallel release-please runs. Concurrent runs can race to update the same release PR, potentially creating duplicate PRs or leaving the manifest in an inconsistent state.
The release-please documentation recommends adding a concurrency group to serialize runs:
| name: Release Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| name: Release Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: release-please | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write |
Using cancel-in-progress: false ensures the latest run completes rather than being cancelled, so no push to main is silently skipped.
| name: Release | ||
|
|
||
| on: | ||
| # Support manually pushing a new release | ||
| workflow_dispatch: {} | ||
| # Trigger when a release is published | ||
| workflow_dispatch: |
There was a problem hiding this comment.
workflow_dispatch publishes from current branch state, not a specific release tag
When this workflow is triggered manually via workflow_dispatch, it checks out the default branch at HEAD — whatever version happens to be in WorkOS.net.csproj at that moment. This is different from the release: [published] path where GITHUB_SHA is pinned to the release tag commit.
This means a manual trigger at the wrong time (e.g., after release-please has bumped the version in a release PR that hasn't been merged yet) could publish a version that doesn't correspond to any tag or release, making it hard to trace what source code was published.
Consider adding an explicit ref input to gate which commit gets published:
workflow_dispatch:
inputs:
ref:
description: 'Git ref (tag or SHA) to publish'
required: true
default: 'main'Then use ref: ${{ inputs.ref }} in the actions/checkout step.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
lint-pr-title.yml) to enforce Conventional Commits, which release-please uses to determine version bumpsrelease.ymlto use NuGet trusted publishing (OIDC) instead of a long-lived API keyChanges
.github/workflows/release-please.yml— runs on push tomain, creates release PRs automatically.github/workflows/lint-pr-title.yml— validates PR titles follow conventional commit formatrelease-please-config.json— configures release-please withsimplerelease type.release-please-manifest.json— tracks current version (2.10.1)src/WorkOS.net/WorkOS.net.csproj— added<!--x-release-please-version -->annotations to<VersionPrefix>and<Version>so release-please can bump them (same pattern used by open-feature/dotnet-sdk).github/workflows/release.yml— switched fromDOTNET_NUGET_API_KEYsecret to NuGet trusted publishing viaNuGet/login@v1; trigger changed fromreleasedtopublishedHow it works
feat:,fix:,chore:, etc.) are enforced on PR titles viaamannn/action-semantic-pull-requestmainrelease-please-actionopens (or updates) a release PR with a version bump andCHANGELOG.mdentryrelease.ymlworkflow triggers on therelease: [published]event and publishes to NuGet using OIDC trusted publishingMirrors workos/workos-ruby#435
Test plan
release.yml, repo owner:workos, repo:workos-dotnet)