Skip to content

ci: handle SemVer pre-release versions in the release workflow#103

Merged
Reefact merged 3 commits into
mainfrom
claude/release-prerelease-flag
Jul 12, 2026
Merged

ci: handle SemVer pre-release versions in the release workflow#103
Reefact merged 3 commits into
mainfrom
claude/release-prerelease-flag

Conversation

@Reefact

@Reefact Reefact commented Jul 12, 2026

Copy link
Copy Markdown
Owner

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 because gh release create was not passed --prerelease.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • release.yml — flag pre-releases (c6e3bdb): in Publish GitHub Release, mark the release --prerelease when $VERSION contains a - (any SemVer pre-release label: -preview.1, -beta.1, -rc.1, …). A stable X.Y.Z gets 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 as true/false and pass it explicitly on gh release create; on a re-run (release already exists → create fails) the fallback now runs gh release edit --prerelease=… after gh release upload --clobber, because upload alone cannot change the flag. Idempotent in both directions.
  • Maintainer docs — pre-release labels (20db55c): add a "Pre-release labels" table to the release workflow reference (EN + FR) covering alpha/beta/preview/rc/nightly/the repo's own dry placeholder, plus SemVer precedence and the nuget/vpre rationale. Also documented the --prerelease behavior as a "Handle with care" bullet.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

Verified the shell detection + fallback branching locally (stubbing gh):

1.0.0            -> --prerelease=false   (stable, no flag)
0.1.0-preview.1  -> --prerelease=true
1.0.0-beta.1     -> --prerelease=true
2.0.0-rc.2       -> --prerelease=true
0.0.0-dry.1      -> --prerelease=true

Fallback path confirmed to run upload --clobber then edit --prerelease=<state>.

No build/test commands were run (workflow + maintainer-docs change only).

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/README.fr.md) updated if user-facing behavior changed
  • No documentation change required

Docs updated here are the maintainer workflow reference (maintainers/workflows/release.en.md + .fr.md), kept in sync EN/FR; no user-facing doc/ or README changes.

Related issues

🤖 Generated with Claude Code

https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/release.yml Outdated
claude added 2 commits July 12, 2026 13:15
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
@Reefact Reefact changed the title ci: mark SemVer pre-releases as prerelease on GitHub ci: handle SemVer pre-release versions in the release workflow Jul 12, 2026
@Reefact

Reefact commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex Is the fix okay for u ?

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 20db55cecd

ℹ️ 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".

@Reefact Reefact merged commit 949e4fb into main Jul 12, 2026
11 checks passed
@Reefact Reefact deleted the claude/release-prerelease-flag branch July 12, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants