Skip to content

Enable SourceLink, deterministic CI builds, and .snupkg symbol packages - #13

Merged
Romain-OD merged 2 commits into
mainfrom
copilot/enable-sourcelink-symbols-deterministic-builds
Oct 20, 2026
Merged

Romain-OD merged 2 commits into
mainfrom
copilot/enable-sourcelink-symbols-deterministic-builds

Conversation

Copilot AI commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Shipped packages had no SourceLink, no symbol packages, and no deterministic CI builds — so consumers got decompiled IL instead of real source, the NuGet.org symbol server had nothing to serve, and shipped DLLs couldn't be verified against the tagged commit.

Changes

New Directory.Build.props (repo root, applies to packable projects only via IsPackable != false — the 10 libraries, not tests/examples):

<PropertyGroup Condition="'$(IsPackable)' != 'false'">
  <PublishRepositoryUrl>true</PublishRepositoryUrl>
  <EmbedUntrackedSources>true</EmbedUntrackedSources>
  <IncludeSymbols>true</IncludeSymbols>
  <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
  <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
  • SourceLink: built into the .NET 8+ SDK, so property flags alone activate it — no Microsoft.SourceLink.GitHub package reference needed.
  • Symbols: IncludeSymbols + SymbolPackageFormat=snupkg makes dotnet pack emit a .snupkg per package.
  • Determinism: ContinuousIntegrationBuild is CI-scoped on purpose; setting it locally normalizes source paths and breaks local debugging.

.github/workflows/publish-nuget.yml: added a step pushing ./nupkgs/*.snupkg to the NuGet.org symbol server alongside the existing *.nupkg push.

Verification highlights

  • dotnet pack -c Release emits 10 .nupkg + 10 .snupkg.
  • .nuspec contains <repository type="git" url="..." commit="<exact HEAD sha>"/>.
  • .snupkg PDBs embed {"documents":{"/_/*":"https://raw.githubusercontent.com/Romain-OD/MessageValidation/<sha>/*"}} with /_/-normalized document paths (no local machine paths).
  • The existing dotnet pack --no-build flow still produces symbols — IncludeSymbols/SymbolPackageFormat are evaluated at pack time, so no workflow restructuring was needed.

Co-authored-by: Romain-OD <31764259+Romain-OD@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable SourceLink, deterministic builds, and .snupkg symbol packages Enable SourceLink, deterministic CI builds, and .snupkg symbol packages Oct 14, 2026
Copilot AI requested a review from Romain-OD October 14, 2026 16:18
@Romain-OD
Romain-OD marked this pull request as ready for review October 20, 2026 15:58
@Romain-OD
Romain-OD merged commit 425fb56 into main Oct 20, 2026
1 check passed
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.

Enable SourceLink, deterministic builds, and .snupkg symbol packages

2 participants