Repository navigation
Description
Problem
The packages ship without any debugging or provenance support:
- No SourceLink. No
PublishRepositoryUrl/EmbedUntrackedSourcesin any project, and no SourceLink package reference. A consumer stepping intoMessagePipelinein the debugger sees decompiled IL, not the real source. - No symbol packages.
.github/workflows/publish-nuget.yml:31pushes only*.nupkg:Nodotnet nuget push ./nupkgs/*.nupkg --api-key ... --skip-duplicate.snupkgis produced or pushed, so the NuGet.org symbol server has nothing to serve. - No deterministic CI build.
ContinuousIntegrationBuildis not set, so binaries embed local machine paths and are not byte-for-byte reproducible.
Consequences: no step-into debugging for adopters, no "Source repository" link on the NuGet.org listing, and no way for a security-conscious consumer to verify the shipped DLL was built from the tagged commit. All three are now baseline expectations for a serious .NET library.
Proposed change
SourceLink for GitHub is built into the .NET SDK since .NET 8 — no Microsoft.SourceLink.GitHub package reference is needed. Setting the properties is enough.
Add to a shared Directory.Build.props (see the central-properties issue) or to each packable project:
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>ContinuousIntegrationBuild is scoped to CI on purpose — enabling it locally normalizes source paths and breaks local debugging.
Then push the symbol packages in .github/workflows/publish-nuget.yml:
- name: Push to NuGet.org
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
+
+ - name: Push symbols to NuGet.org
+ run: dotnet nuget push ./nupkgs/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicateNote: the Build & Test workflow uses dotnet pack --no-build; confirm symbol generation still happens there, or drop --no-build for the pack-validation step only.
Acceptance criteria
-
dotnet pack -c Releaseemits both.nupkgand.snupkgfor all 10 packages - The
.nupkg.nuspeccontains arepositoryelement withurl,type="git", and the exactcommitSHA -
publish-nuget.ymlpushes*.snupkgalongside*.nupkg - The NuGet.org package page shows a "Source repository" link
- Step-into debugging from a consumer project lands on real source
Activity