Publishing
Publish a NuGet package
Push a .nupkg with dotnet nuget push.
The same rules apply as for npm: a publisher role and a reserved package id. Pack the project, then push it with your token as the API key:
$ dotnet pack -c Release -o nupkgs Successfully created package '/work/Acme.Logging/nupkgs/Acme.Logging.1.4.0.nupkg'. $ dotnet nuget push "nupkgs/*.nupkg" --source https://packages.example.com/nuget/v3/index.json --api-key "$REPO_TOKEN" Pushing Acme.Logging.1.4.0.nupkg to 'https://packages.example.com/nuget/api/v2/package'... PUT https://packages.example.com/nuget/api/v2/package/ warn : Acme.Logging 1.4.0 is pushed. It is listed once its malware scan is clean Created https://packages.example.com/nuget/api/v2/package/ 288ms Your package was pushed.
Captured by running these commands against a real ForgeRepo™.
- The feed address is the same one you restore from. dotnet finds where to push in it.
- A pushed version never changes.
dotnet nuget deleteis refused, so push a new version instead. - A new push is held until its malware scan is clean, or until an admin releases it. Then
dotnet add packagesees it.