Fix clean NuGet packaging and retry-safe versioning - #130
Merged
Conversation
magiccodingman
marked this pull request as ready for review
August 21, 2026 16:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the clean-run NuGet packaging failure from release workflow run 1 and prevents the failed attempt from skipping version
2.0.3.dotnet packto perform the build required to generate Razor static-web-assets manifestsbin/objoutput cannot hide this regressionGITHUB_RUN_NUMBERRoot cause
Magic.IndexedDb.csprojenablesGeneratePackageOnBuild. NuGet's pack targets therefore omit their normal build dependency to avoid a build/pack cycle. The publish job restored the project and calleddotnet packon a fresh runner without overriding that property, so the Razor SDK tried to packageobj/Release/net10.0/staticwebassets.build.jsonbefore any build had generated it.Core validation did not fail because its package command already supplied
GeneratePackageOnBuild=false, and it ran after unit tests had populated Release intermediates. The publish job used a separate runner and a slightly different command. Both paths now call.github/scripts/pack-nuget.sh, and the package smoke test deliberately runs before unit tests.Version behavior
The failed release was workflow run 1, so the former
source patch + GITHUB_RUN_NUMBERcalculation would turn the next push into2.0.4even though2.0.3was never published.The new calculation reads the checked-in stable version as the intended major/minor release line and a patch floor, validates NuGet's official package-version index, and chooses one patch above the newest matching published version or source floor. Consequently:
2.0.22.0.22.0.32.0.3exists, the following release resolves to2.0.4Verification
bin,obj, or artifact directories and restored from scratchMagic.IndexedDb.2.0.3.nupkg2.0.32.0.3git diff --checkpassAfter merge
Merge
masterinto the protectedreleasebranch again. The release workflow will repeat all required core and browser gates, then build and publish2.0.3through trusted publishing.No runtime code, public API, Dexie asset, or checked-in package version was changed.