Skip to content

build(csharp): prepare NuGet package for nuget.org publishing#668

Merged
anakrish merged 3 commits intomicrosoft:mainfrom
anakrish:csharp/nuget-publish-prep
Apr 9, 2026
Merged

build(csharp): prepare NuGet package for nuget.org publishing#668
anakrish merged 3 commits intomicrosoft:mainfrom
anakrish:csharp/nuget-publish-prep

Conversation

@anakrish
Copy link
Copy Markdown
Collaborator

@anakrish anakrish commented Apr 8, 2026

Getting the C# bindings ready to publish on nuget.org.

The package is renamed from Regorus to Microsoft.Regorus so it sits under
the reserved Microsoft.* prefix (which matches the namespace we already use).

In-repo projects (tests, sample apps) now default to ProjectReference for
a smoother dev inner loop. CI flips them to PackageReference with
/p:UsePackageReference=true so we actually validate the .nupkg end-to-end.

A nuget.config with package source mapping pins Microsoft.Regorus to a
local source during xtask testing, and --configfile is passed everywhere
so restores behave the same on dev machines and CI.

Also:

  • Version-bump helper now updates Directory.Packages.props (CPM) too
  • CI artifact upload glob fixed for the new package name

@anakrish anakrish requested a review from Copilot April 8, 2026 20:57
Copy link
Copy Markdown

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

Prepares the C# bindings for publishing/consuming the NuGet package under the Microsoft.Regorus identity, and adjusts the xtask C# test flow to restore from a local package source.

Changes:

  • Renames the NuGet package identity from Regorus to Microsoft.Regorus across C# projects and xtask helpers.
  • Adds a bindings/csharp/nuget.config and updates xtask test-csharp to copy locally built .nupkg files into bindings/csharp/local-packages/.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
xtask/src/tasks/bindings/version.rs Updates regex used by version-bump workflow to target microsoft.regorus package references.
xtask/src/tasks/bindings/csharp.rs Updates local package handling and adds a dotnet restore verification step for package source mapping.
bindings/csharp/TestApp/TestApp.csproj Switches between project reference vs Microsoft.Regorus package via UsePackageReference.
bindings/csharp/TargetExampleApp/TargetExampleApp.csproj Same conditional project/package reference switch as TestApp.
bindings/csharp/Regorus/Regorus.csproj Sets PackageId to Microsoft.Regorus.
bindings/csharp/Regorus.Tests/Regorus.Tests.csproj Adds conditional project reference vs Microsoft.Regorus package reference.
bindings/csharp/nuget.config Introduces NuGet sources + packageSourceMapping including a local feed.
bindings/csharp/Directory.Packages.props Updates centrally-managed package version entry to Microsoft.Regorus.
bindings/csharp/Benchmarks/Benchmarks.csproj Adds conditional project reference vs Microsoft.Regorus package reference.
bindings/csharp/.gitignore Ignores the generated local-packages/ directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

anakrish added 2 commits April 8, 2026 16:56
Align the NuGet package identity with the Microsoft.Regorus
namespace and the Microsoft.* reserved prefix on nuget.org
in preparation for publishing the package.

- Add explicit <PackageId>Microsoft.Regorus</PackageId>
- Update PackageVersion in Directory.Packages.props
- Update version bump regex for new package name
Use ProjectReference for Regorus.Tests, Benchmarks, TestApp,
and TargetExampleApp so that local development does not require
a pre-built .nupkg. PackageReference mode remains available via
/p:UsePackageReference=true for validating the packaged NuGet.
@anakrish anakrish force-pushed the csharp/nuget-publish-prep branch from 3b53be6 to 836fba8 Compare April 8, 2026 21:57
@anakrish anakrish requested a review from Copilot April 8, 2026 21:59
Copy link
Copy Markdown

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish force-pushed the csharp/nuget-publish-prep branch 2 times, most recently from 013eae2 to 5362272 Compare April 9, 2026 00:55
@anakrish anakrish requested a review from Copilot April 9, 2026 00:55
Copy link
Copy Markdown

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…tion

Add explicit NuGet configuration to ensure in-repo builds always
resolve Microsoft.Regorus from the locally built package, even
after the package is published on nuget.org.

- Add nuget.config with <clear/> and packageSourceMapping
- Update xtask to copy .nupkg into local-packages/ directory
- Pass /p:UsePackageReference=true from xtask for CI testing
- Add restore validation step to the xtask test flow
- Add .gitignore for the local-packages directory
Copy link
Copy Markdown

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish changed the title Csharp/nuget publish prep build(csharp): prepare NuGet package for nuget.org publishing Apr 9, 2026
@anakrish anakrish requested a review from dpokluda April 9, 2026 01:45
@anakrish anakrish marked this pull request as ready for review April 9, 2026 01:45
@anakrish anakrish requested review from Copilot and dekomissMSFT April 9, 2026 01:45
Copy link
Copy Markdown

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish merged commit b9eca93 into microsoft:main Apr 9, 2026
67 checks passed
@anakrish anakrish deleted the csharp/nuget-publish-prep branch April 9, 2026 21:40
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.

3 participants