ci: handle SemVer pre-release versions in the release workflow#103
Conversation
The Publish GitHub Release step now passes `--prerelease` to `gh release create` whenever the resolved version carries a SemVer pre-release label (anything after '-', e.g. -preview.1, -beta.1, -rc.1). Build metadata '+...' is already rejected in "Resolve version", so a '-' is unambiguously the pre-release separator. This stops a preview from appearing as the repo's "Latest" release and matches how nuget.org lists the same package. Documented the behavior in the maintainer workflow reference (EN + FR). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6e3bdbd62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The publish step now computes PRERELEASE as true/false and passes it explicitly (`--prerelease=$PRERELEASE`) to `gh release create`. On a re-run the release already exists, so create fails and the fallback runs: it now also runs `gh release edit --prerelease=$PRERELEASE` after re-uploading assets, because `gh release upload` cannot change the prerelease flag. This keeps a repair run idempotent in both directions (stable and pre-release), addressing review feedback on the initial change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg
Add a "Pre-release labels" section to the maintainer release workflow reference (EN + FR) with a table explaining the common SemVer pre-release labels (alpha, beta, preview, rc, nightly/dev, and this repo's own dry-run `dry` placeholder), plus a short note on SemVer precedence and why NuGet pre-releases need `--prerelease` (hence the `nuget/vpre` badge). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg
|
@codex Is the fix okay for u ? |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Makes the release workflow treat SemVer pre-release versions correctly, and documents the label conventions. A preview/beta/rc no longer shows up as the repository's "Latest" GitHub Release — aligning GitHub with how nuget.org already lists the same package.
Motivated by
v0.1.0-preview.1, which published fine but appeared as a normal "Latest" release becausegh release createwas not passed--prerelease.Type of change
Changes
release.yml— flag pre-releases (c6e3bdb): in Publish GitHub Release, mark the release--prereleasewhen$VERSIONcontains a-(any SemVer pre-release label:-preview.1,-beta.1,-rc.1, …). A stableX.Y.Zgets no flag. Build metadata (+…) is already rejected in Resolve version, so a-is unambiguously the pre-release separator.release.yml— reconcile on the fallback path (9b4681a, addresses review feedback): compute the state astrue/falseand pass it explicitly ongh release create; on a re-run (release already exists → create fails) the fallback now runsgh release edit --prerelease=…aftergh release upload --clobber, becauseuploadalone cannot change the flag. Idempotent in both directions.20db55c): add a "Pre-release labels" table to the release workflow reference (EN + FR) coveringalpha/beta/preview/rc/nightly/the repo's owndryplaceholder, plus SemVer precedence and thenuget/vprerationale. Also documented the--prereleasebehavior as a "Handle with care" bullet.Testing
dotnet build FirstClassErrors.slndotnet test FirstClassErrors.slnFirstClassErrors.Analyzers.UnitTests)Verified the shell detection + fallback branching locally (stubbing
gh):Fallback path confirmed to run
upload --clobberthenedit --prerelease=<state>.No build/test commands were run (workflow + maintainer-docs change only).
Documentation
doc/updateddoc/README.fr.md) updated if user-facing behavior changedDocs updated here are the maintainer workflow reference (
maintainers/workflows/release.en.md+.fr.md), kept in sync EN/FR; no user-facingdoc/or README changes.Related issues
🤖 Generated with Claude Code
https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg