This document provides step-by-step instructions for releasing CycloneDDS.NET to NuGet.org.
Before you begin, ensure you have:
- Maintainer Access to the GitHub repository
- NuGet API Key with push permissions for the CycloneDDS.NET package
- Development Environment with:
- .NET 8.0 SDK or later
- PowerShell
- Git command-line tools
This project uses Nerdbank.GitVersioning (NBGV) for automatic semantic versioning.
-
Automatic Version Calculation: NBGV determines the version based on:
- Git tags (e.g.,
v1.0.0) - Git commit height since the last tag
- Branch name
- Git tags (e.g.,
-
Version Format:
{Major}.{Minor}.{Patch}-{Prerelease}+{GitCommitId}- Example:
1.0.5-alpha.3+g7e041a2787
- Example:
Version settings are stored in version.json:
{
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/tags/v\\d+\\.\\d+"
]
}Pre-releases are automatically created by CI for every commit to main.
Process:
- Merge your PR to
main - CI automatically builds and publishes (if configured)
- Package version:
1.0.x-alpha+{commitId}
Manual Pre-Release:
# Build the package
.\build\pack.ps1
# Packages will be in artifacts/nuget/
# Example: CycloneDDS.NET.1.0.5-alpha-g7e041a2787.nupkgStable releases are created by tagging a commit.
Process:
-
Update CHANGELOG.md:
## [1.0.0] - 2026-02-14 ### Added - Feature descriptions ### Fixed - Bug fixes
-
Commit the changelog:
git add CHANGELOG.md git commit -m "Prepare release v1.0.0" git push origin main
-
Tag the release commit:
git tag v1.0.0 git push origin v1.0.0
-
Verify the tag:
git describe --tags # Should output: v1.0.0
The CI pipeline should automatically build the tagged version.
To build locally:
# Clean previous builds
Remove-Item -Recurse -Force artifacts/ -ErrorAction SilentlyContinue
# Build the package
.\build\pack.ps1
# Verify the version
# Check artifacts/nuget/ for CycloneDDS.NET.1.0.0.nupkg (no prerelease suffix)Before publishing, inspect the package contents:
# Option 1: Use NuGet Package Explorer (GUI)
# Download from: https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
# Option 2: Extract and inspect manually
Expand-Archive artifacts/nuget/CycloneDDS.NET.1.0.0.nupkg -DestinationPath temp_inspect
# Verify contents:
# - icon.png is present
# - README.md is present
# - ThirdPartyNotices.txt is present
# - Native binaries are in runtimes/ folder
# - Build tools are in build/ or buildTransitive/ folderKey Things to Check:
- Package version is correct (no
-alphasuffix for stable) -
icon.pngis at package root -
README.mdis at package root -
ThirdPartyNotices.txtis at package root - Native libraries:
runtimes/win-x64/native/ddsc.dll - Build tools:
tools/orbuild/folder with code generators - Symbol package (
.snupkg) is generated
If CI is configured to auto-publish on tags:
- Wait for CI to complete after pushing the tag
- Verify on NuGet.org that the new version appears
- Create a GitHub Release with release notes
One-time setup:
# Get your API key from: https://www.nuget.org/account/apikeys
# Create a key with "Push new packages and package versions" permission
# Store the key (safer than using it directly in commands)
$apiKey = "your-api-key-here"
# Or use the dotnet tool to store it:
dotnet nuget add source https://api.nuget.org/v3/index.json `
--name nuget.org `
--api-key $apiKeySecurity Best Practice: Store API keys as GitHub Secrets for CI, never commit them to the repository.
# Navigate to the package directory
cd artifacts/nuget
# Push the main package
dotnet nuget push CycloneDDS.NET.1.0.0.nupkg `
--source https://api.nuget.org/v3/index.json `
--api-key $apiKey
# Push the symbol package
dotnet nuget push CycloneDDS.NET.1.0.0.snupkg `
--source https://api.nuget.org/v3/index.json `
--api-key $apiKey-
Check NuGet.org: https://www.nuget.org/packages/CycloneDDS.NET/
- Verify the new version appears
- Check that the icon displays correctly
- Verify the README is visible on the package page
-
Test Installation:
mkdir test-install cd test-install dotnet new console dotnet add package CycloneDDS.NET --version 1.0.0 dotnet build -
Verify Package Contents:
- Native libraries are copied to output
- Code generation works during build
- Go to: https://github.com/pjanec/CycloneDds.NET/releases/new
- Select the tag:
v1.0.0 - Release title:
CycloneDDS.NET v1.0.0 - Description: Copy relevant sections from
CHANGELOG.md - Attach build artifacts (optional):
CycloneDDS.NET.1.0.0.nupkgCycloneDDS.NET.1.0.0.snupkg
- Click "Publish release"
- Update README badges if necessary
- Announce the release (social media, mailing lists, etc.)
- Close any related milestone on GitHub
Update CHANGELOG.md with a new [Unreleased] section:
## [Unreleased]
### Added
### Changed
### FixedProblem: NBGV is not detecting the new tag.
Solution:
# Verify tags are correct
git tag -l
# Ensure you've pushed the tag
git push origin v1.0.0
# Check NBGV version calculation
nbgv get-versionProblem: 409 Conflict - The package version already exists.
Solution:
- NuGet.org does not allow overwriting published packages
- You must increment the version (even for bug fixes)
- Hotfix: Create a new patch version (e.g.,
v1.0.1)
Problem: icon.png or README.md not in the package.
Solution:
- Verify
Directory.Build.propshas the<None Include=...>elements - Check file paths are correct (use
$(MSBuildThisFileDirectory)) - Clean and rebuild:
Remove-Item -Recurse artifacts/ .\build\pack.ps1
Problem: Symbol package fails to upload.
Solution:
- Ensure PDB files are embedded or included
- Check
<IncludeSymbols>true</IncludeSymbols>inDirectory.Build.props - Symbol packages are optional; main package can be published without them
- NuGet.org Account: https://www.nuget.org/account
- API Key Management: https://www.nuget.org/account/apikeys
- NBGV Documentation: https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/nbgv-cli.md
- NuGet Package Explorer: https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
If a release has critical issues:
-
Unlist (deprecate) the package version on NuGet.org:
- Go to the package page -> Manage Package
- Select the version and click "Unlist"
- This hides it from search but existing dependencies still work
-
Publish a hotfix version immediately:
- Create a fix branch
- Tag a new version (e.g.,
v1.0.1) - Follow the release process
-
Communicate the issue:
- Update the GitHub release with a warning
- Post an issue describing the problem
Last Updated: February 2026
Maintained By: CycloneDDS.NET Authors