1. Resources
  2. /
  3. Examples
  4. /
  5. Build & Publish NuGet Package To Buildkite Package Registries

Build Hello.Buildkite example NuGet package and publish to Buildkite Package Registries

This Github repo is configured to use Buildkite to build a NuGet packet and publish it to a NuGet registry on Buildkite Package Registries.

See the full Getting Started Guide for step-by-step instructions on how to get this running.

  • Buildkite Packages NuGet Example Pipeline
Screenshot of Buildkite Packages NuGet example pipeline
  • Buildkite Packages NuGet Example ‘Publish NuGet Package’ Log
Screenshot of Buildkite Packages NuGet example 'Publish NuGet Package' log
  • Buildkite Packages Registry With Published NuGet Package’
Screenshot of Buildkite Packages registry with published NuGet package

Quick Start

  • Create NuGet registry in Buildkite Package Registries
    • Name the registry: ‘packages-nuget-example-registry’
      • Change ‘.buildkite/pipeline.yml’
        • The publish-to-packages plugin ‘registry’ should point to you <YOUR_ORGANIZATION_SLUG>/<YOUR_REGISTRY_SLUG>
- publish-to-packages#v2.2.0:
    ...
    registry: "anothertest/packages-nuget-example-registry" <==== CHANGE
    ...
- iss: https://agent.buildkite.com
  scopes:
    - read_packages
    - write_packages
  claims:
    organization_slug:
      equals: anothertest
    pipeline_slug:
      in:
        - packages-nuget-example-pipeline
    build_branch:
      matches:
        - main
        - feature/*

Details

Main Files

Contains the NuGet package project files that we will build.

  • README.md
    • This file
  • Program.cs
    • The program written in C# that we will build
  • Hello.Buildkite.csproj
    • dotnet build configuration file

’.buildkite/’ Folder

Contains Buildkite setup/configuration to build the project into a NuGet package and publish to Buildkite Package Registries.

  • docker-compose.yml
    • Since NuGet package build requires ‘dotnet’ we use ‘docker-compose.yml’ so we can pull/instantiate a OCI image with ‘dotnet’ pre-installed
    • The alternative is a build a base image containing ‘dotnet’ that Buildkite agent can use, but this involves setup that cannot be captured in this Github repo
  • pipeline.yml
    • The file defining the steps in the Buildkite pipeline

References

License

See LICENSE.md (MIT)

More examples

Start turning complexity into an advantage

Create an account to get started for free.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Security
  5. Brand assets
  6. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025