Publish .snupkg symbols package to NuGet.org#1345
Merged
Merged
Conversation
The .NET SDK csproj already builds a portable-PDB .snupkg alongside the main .nupkg (IncludeSymbols + SymbolPackageFormat=snupkg, with SourceLink), but the publish workflow only uploaded and pushed the .nupkg, so symbols never reached the NuGet.org symbol server. Update the publish-dotnet job to include *.snupkg in the uploaded artifact, push the main .nupkg with --no-symbols, then explicitly push the .snupkg to https://api.nuget.org/v3/index.json (which dispatches to NuGet.org's symbol endpoint). Closes #1213 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions publishing workflow for the .NET SDK so that the already-produced .snupkg symbol packages are uploaded and published to NuGet.org alongside the main .nupkg, enabling source stepping/debugging via NuGet’s symbols server.
Changes:
- Upload both
dotnet/artifacts/*.nupkganddotnet/artifacts/*.snupkgas thedotnet-packageworkflow artifact. - Push the main
.nupkgwithdotnet nuget push --no-symbolsto avoid implicit symbol publishing. - Explicitly push
*.snupkgto NuGet.org after the main package push.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish.yml |
Extends the .NET publish job to include and explicitly push .snupkg symbol packages to NuGet.org. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Collaborator
Author
|
@SteveSandersonMS any concerns? |
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.
The .NET SDK csproj already produces a portable-PDB
.snupkgalongside the main.nupkg(IncludeSymbols+SymbolPackageFormat=snupkg, withMicrosoft.SourceLink.GitHuband deterministic CI builds), but thepublish-dotnetworkflow job only uploaded and pushed the.nupkg. As a result, symbols were built every release but never reached NuGet.org's symbol server, so consumers couldn't step into the SDK with a debugger viahttps://symbols.nuget.org/download/symbols.This updates the workflow to:
dotnet/artifacts/*.snupkgin thedotnet-packageworkflow artifact alongside*.nupkg..nupkgwith--no-symbols(the symbol push is now explicit, so there's no value in letting the main push try to auto-discover and re-push the symbols package).*.snupkgtohttps://api.nuget.org/v3/index.json, whichdotnet nuget pushdispatches to NuGet.org's symbol endpoint.This matches the publishing pattern recommended in NuGet's own docs and used by mature .NET OSS libraries (the .NET runtime, ASP.NET Core, Microsoft.Extensions.*, etc.).
I verified locally that
dotnet pack -c Releasealready produces both files, that the PDBs inside the.snupkgare portable (BSJB header) for all three target frameworks, and that an explicit.snupkgpush hits NuGet.org'sapi/v2/symbolpackageendpoint as expected.Closes #1213
This pull request was generated by Copilot.