fix(build): enable ReadyToRun and trimming only when publishing #79

Merged
KofTwentyTwo merged 1 commits from fix/publish-only-r2r into main 2026-10-10 13:06:46 +00:00
1 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.1 9dd889e26f fix(build): enable ReadyToRun and trimming only when publishing
gclo.csproj turned PublishReadyToRun and PublishTrimmed on for every non-Debug
configuration, so a plain `dotnet build -c Release` needed the crossgen pack,
which only a restore made with that property downloads. The shared release
workflow restores once without a configuration and then builds Release, and on
a clean runner that failed with NETSDK1094 (rehearsal v1.0.1-beta.2); locally
it passed only because the cache already held the pack.

Both properties now apply only under `_IsPublishing` (set by `dotnet publish`),
so the publish step's own restore fetches what it needs and a Release build
needs nothing extra. Verified against an empty NuGet cache with the workflow's
exact restore, build, test and publish commands.

Closes #78

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-10 08:00:34 -05:00