Skip to content

Publish .snupkg symbols package to NuGet.org#1345

Merged
stephentoub merged 1 commit into
mainfrom
stephentoub/investigate-nuget-symbols
May 20, 2026
Merged

Publish .snupkg symbols package to NuGet.org#1345
stephentoub merged 1 commit into
mainfrom
stephentoub/investigate-nuget-symbols

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

The .NET SDK csproj already produces a portable-PDB .snupkg alongside the main .nupkg (IncludeSymbols + SymbolPackageFormat=snupkg, with Microsoft.SourceLink.GitHub and deterministic CI builds), but the publish-dotnet workflow 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 via https://symbols.nuget.org/download/symbols.

This updates the workflow to:

  • Include dotnet/artifacts/*.snupkg in the dotnet-package workflow artifact alongside *.nupkg.
  • Push the main .nupkg with --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).
  • Then explicitly push *.snupkg to https://api.nuget.org/v3/index.json, which dotnet nuget push dispatches 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 Release already produces both files, that the PDBs inside the .snupkg are portable (BSJB header) for all three target frameworks, and that an explicit .snupkg push hits NuGet.org's api/v2/symbolpackage endpoint as expected.

Closes #1213

This pull request was generated by Copilot.

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>
Copilot AI review requested due to automatic review settings May 20, 2026 14:28
@stephentoub stephentoub requested a review from a team as a code owner May 20, 2026 14:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/*.nupkg and dotnet/artifacts/*.snupkg as the dotnet-package workflow artifact.
  • Push the main .nupkg with dotnet nuget push --no-symbols to avoid implicit symbol publishing.
  • Explicitly push *.snupkg to 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

@stephentoub
Copy link
Copy Markdown
Collaborator Author

@SteveSandersonMS any concerns?

@stephentoub stephentoub merged commit 477834f into main May 20, 2026
15 checks passed
@stephentoub stephentoub deleted the stephentoub/investigate-nuget-symbols branch May 20, 2026 21:03
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.

Add symbols to NuGet package or symweb

3 participants