Skip to content

ci: restore version bumping via craft preReleaseCommand#5261

Merged
dingsdax merged 2 commits into
mainfrom
fix/craft-prerelease-bump-version
May 28, 2026
Merged

ci: restore version bumping via craft preReleaseCommand#5261
dingsdax merged 2 commits into
mainfrom
fix/craft-prerelease-bump-version

Conversation

@jamescrosswell
Copy link
Copy Markdown
Collaborator

@jamescrosswell jamescrosswell commented May 27, 2026

Closes #5260

What happened

The release: 6.6.0 commit (0140be0) only modified CHANGELOG.md<VersionPrefix> in Directory.Build.props was left at 6.5.0. Every nupkg built in the publish step was therefore named *.6.5.0.nupkg, and that's what got attached to the 6.6.0 GitHub release (and pushed to NuGet).

For comparison, the 6.5.0 release commit correctly bumped both CHANGELOG.md and Directory.Build.props (6.4.1 → 6.5.0).

Root cause

From the craft prepare log in run 26499066767:

[info] Running automatic version bumping from targets...
[debug] Running version bump for target "nuget"...
[debug] dotnet-setversion not available, falling back to manual edit
[debug] Target "nuget" did not apply (detection failed)
[warn] Targets [nuget] support version bumping but did not find applicable
       files in your project. Consider adding a preReleaseCommand if you
       need custom version bumping.

Craft 2.26.6's built-in nuget auto-bumper looks for the dotnet-setversion CLI, doesn't find it on the runner image, falls back to a "manual edit" heuristic that doesn't recognize Directory.Build.props, and downgrades the failure to a warning — so prepare carries on and commits/tags with the stale version.

This regressed when #5206 bumped craft minVersion to opt into the auto versioning strategy. Before that, the repo's own scripts/bump-version.ps1 was rewriting <VersionPrefix> via the older pre-release hook convention; the switch to craft-native auto-bump dropped that wiring.

#skip-changelog

jamescrosswell and others added 2 commits May 28, 2026 10:46
#skip-changelog

Craft 2.26.6's built-in nuget auto-bumper looks for the `dotnet-setversion`
CLI and, when not found, falls back to a "manual edit" heuristic that does
not recognize `Directory.Build.props`. It downgrades the failure to a warn
and lets prepare continue, so the `release: 6.6.0` commit only updated
CHANGELOG.md and the resulting nupkg files were named `*.6.5.0.nupkg`.

The repo's own scripts/bump-version.sh already rewrites <VersionPrefix>
correctly. Wire it back in via craft's preReleaseCommand, as the warning
in the prepare log recommends.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
#skip-changelog

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.09%. Comparing base (4a85500) to head (4f4a0fe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5261      +/-   ##
==========================================
- Coverage   74.13%   74.09%   -0.04%     
==========================================
  Files         508      508              
  Lines       18320    18320              
  Branches     3584     3584              
==========================================
- Hits        13581    13575       -6     
- Misses       3864     3872       +8     
+ Partials      875      873       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell jamescrosswell marked this pull request as ready for review May 27, 2026 23:13
@jamescrosswell jamescrosswell requested a review from Flash0ver as a code owner May 27, 2026 23:13
@dingsdax dingsdax merged commit c6795c6 into main May 28, 2026
38 checks passed
@dingsdax dingsdax deleted the fix/craft-prerelease-bump-version branch May 28, 2026 04:26
@jamescrosswell jamescrosswell added the skip-changelog Suppress automatic changelog generation via Craft label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Suppress automatic changelog generation via Craft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6.6.0 Github release has v6.5.0 assets associated with it

2 participants