Skip to main content
Enterprise Agile Planning icon with arrows

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Feb 05, 2013 — Enterprise Agile Planning expert

Using a Jenkins Promoted Job to Publish to NuGet

Enterprise Agile Planning
We've started publishing our .NET API Client library via NuGet. While each build is published to a private MyGet repository, we wanted to approve the versions that get published to the primary NuGet feed, including a chance to bump up version numbers based on semantic versioning concerns before the world started using a particular build. There is a Promoted Builds Plugin available for Jenkins that allows action to be taken on a build based on criteria that include "manual approval", and it turns out this plugin is pretty easy to setup for this need:
  • Set a Jenkins variable for your NuGet API key.  I set it in Jenkins' global configuration.
  • Make sure NuGet is available to your build process. Perhaps check in the .nuget directory with the EXE. We have a separate repo that contains solely the nuget tool, which we clone before use.
  • Install the Promoted Builds Plugin from Jenkins' management page.
  • Have your job produce a .nupkg file (With symbols!) and archive it as an artifact.
  • Setup the promotion job.
    • We chose to wait for both manual approval AND the completion of downstream tests.
    • Setup a promoted job step to copy the .nupkg artifacts from the main job. Specify the jenkins variable $PROMOTED_JOB for the build number of the upstream job.
    • In a shell or batch step, call NuGet.exe push $NUPKG $NUGET_API_KEY
Once that's done, you can touch off the promotion from the job's "Promotion Status" screen, as well as view the promotion job status and log.

More from the Blog

View more
Nov 22, 2021

What are the qualities of highly effective agile teams?

Enterprise Agile Planning
A team is the core unit of productivity in an agile organization. Wher ...
Read More
Nov 15, 2021

How an open-first attitude revolutionized government tech development

Enterprise Agile Planning
Public perception of government is often that it is slow-moving, reluc ...
Read More
cross functional
Nov 08, 2021

6 best practices for building resilient cross-functional teams

Enterprise Agile Planning
Agile frameworks prize the quality of resilience within every facet of ...
Read More
adoption boom
Oct 25, 2021

Remote work fueled an agile adoption boom in 2020

Enterprise Agile Planning
The COVID-19 pandemic was a catalyst for major changes — not only in t ...
Read More
Contact Us