Skip to main content
Enterprise Agile Planning Image

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
Apr 08, 2021

Making IT services more agile

Enterprise Agile Planning
The agile revolution completely transformed how we create digital prod ...
Read More
Feb 14, 2021

Reflecting on the 20th anniversary of the Agile Manifesto

Enterprise Agile Planning
Over the past 20 years, it’s been amazing to watch an idea from ...
Read More
Feb 08, 2021

How does agile apply to an entire organization?

Enterprise Agile Planning
Before we dive into the main subject of this blog post, it is importan ...
Read More
Feb 03, 2021

It took a pandemic to realize why digital transformation actually matters

Enterprise Agile Planning
Before anyone had ever heard of COVID-19, businesses across the globe ...
Read More
Contact Us