Docs/NuGet Registry/Publishing NuGet Packages

Publishing NuGet Packages

Learn how to create, version, and publish .NET packages to DepAegis using the dotnet CLI and MSBuild properties.

Prerequisites

Before publishing, make sure you have:

Creating a Package with dotnet pack

Use dotnet pack to compile your project and produce a .nupkg file:

dotnet pack --configuration Release

The resulting .nupkg file is placed in the bin/Release/ output directory. You can specify an output directory with --output:

dotnet pack --configuration Release --output ./artifacts

For a more detailed package with metadata, ensure your .csproj includes the relevant properties (see MSBuild Properties for Packaging below).

Publishing with dotnet nuget push

Push the package to DepAegis using the dotnet nuget push command:

dotnet nuget push ./artifacts/MyCompany.Utils.1.0.0.nupkg \
  --source "DepAegis" \
  --api-key "your-api-key"

If you have already set the API key with dotnet nuget setapikey, you can omit the --api-key flag:

dotnet nuget push ./artifacts/MyCompany.Utils.1.0.0.nupkg --source "DepAegis"
DepAegis enforces immutable versions. Once a package version is published, it cannot be overwritten. You must increment the version number for subsequent pushes.

Symbol Packages (.snupkg)

Symbol packages (debugging information for consumers) are not supported yet. A .snupkg cannot be pushed to DepAegis at this time — building with -p:IncludeSymbols=true works fine (the .snupkg just sits in your artifacts folder); push the .nupkg alone.

Versioning Conventions

DepAegis follows standard NuGet versioning rules based on Semantic Versioning (SemVer):

Version FormatExampleWhen to Use
Major.Minor.Patch1.0.0Stable releases
Major.Minor.Patch-Prerelease1.1.0-beta.1Pre-release versions
Major.Minor.Patch-Build1.0.0+20260611Build metadata (ignored during resolution)

Set the version via the Version property in your .csproj or pass it at the command line:

dotnet pack -p:Version=2.1.0-beta.3 --configuration Release

MSBuild Properties for Packaging

Configure package metadata directly in your .csproj file for reproducible, self-documenting builds:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <PackageId>MyCompany.Utils</PackageId>
    <Version>1.0.0</Version>
    <Authors>Engineering Team</Authors>
    <Company>MyCompany</Company>
    <Description>Internal utility library for MyCompany services.</Description>
    <PackageTags>internal;utilities;mycompany</PackageTags>
    <RepositoryUrl>https://github.com/mycompany/utils</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
    <PackageReadmeFile>README.md</PackageReadmeFile>
  </PropertyGroup>

  <ItemGroup>
    <None Include="README.md" Pack="true" PackagePath="" />
  </ItemGroup>

</Project>
Use PackageReadmeFile to embed a README in your package. It will be displayed on the DepAegis package detail page.

CI/CD Publishing

For automated publishing from CI pipelines, store your DepAegis API key as a secure secret and pass it via environment variable or pipeline parameter:

# GitHub Actions example
- name: Publish to DepAegis
  run: |
    dotnet pack --configuration Release -p:Version=${{ env.PACKAGE_VERSION }}
    dotnet nuget push ./artifacts/*.nupkg \
      --source "DepAegis" \
      --api-key "${{ secrets.DEPAEGIS_API_KEY }}"
  env:
    PACKAGE_VERSION: "1.2.0"

For detailed guides, see GitHub Actions, GitLab CI, and Azure DevOps.

Deleting & Unlisting Packages

DepAegis supports unlisting package versions, which hides them from search results and the package listing while keeping them available for existing consumers who reference the version directly.

To unlist a package version, navigate to the package page in the DepAegis dashboard and use the Unlist action. Organization administrators can also permanently delete versions, but this is not recommended as it breaks downstream builds that depend on the exact version.

Permanently deleting a package version is irreversible and will cause dotnet restore failures for any project referencing that version. Prefer unlisting over deletion.