This document describes how to publish the Sirv.RestApi package to NuGet.org.
- .NET SDK 6.0 or later
- A NuGet.org account
- A NuGet API key from nuget.org/account/apikeys
chmod +x build.sh
./build.sh.\build.ps1# Restore dependencies
dotnet restore
# Build in Release mode
dotnet build -c Release
# Create NuGet package
dotnet pack -c Release -o ./artifactsBefore publishing, verify the package contents:
# List package contents
dotnet nuget inspect ./artifacts/Sirv.RestApi.1.0.0.nupkgdotnet nuget push ./artifacts/Sirv.RestApi.1.0.0.nupkg \
--api-key YOUR_NUGET_API_KEY \
--source https://api.nuget.org/v3/index.jsonnuget push ./artifacts/Sirv.RestApi.1.0.0.nupkg \
-ApiKey YOUR_NUGET_API_KEY \
-Source https://api.nuget.org/v3/index.json- Go to nuget.org/packages/manage/upload
- Drag and drop the
.nupkgfile - Verify the package details
- Click "Submit"
The package includes the following metadata (configured in Sirv.RestApi.csproj):
- Package ID: Sirv.RestApi
- Version: 1.0.0
- Authors: Sirv
- License: MIT
- Project URL: https://github.com/sirv/sirv-rest-api-csharp
- Tags: sirv, image, cdn, api, rest, media, asset, management, 360, spin, zoom
To release a new version:
- Update the
<Version>insrc/Sirv.RestApi/Sirv.RestApi.csproj - Update
<PackageReleaseNotes>with changes - Build and publish as described above
The SDK is configured to generate symbol packages (.snupkg) for better debugging experience. These are automatically uploaded alongside the main package when using dotnet nuget push.
If you see this error, the version already exists on NuGet.org. Increment the version number in the .csproj file.
Ensure your API key:
- Has not expired
- Has the "Push" scope
- Is associated with the correct account
Ensure you have the correct .NET SDK installed:
dotnet --list-sdksThe SDK requires .NET 6.0 or later for building.