Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate NuGet package creation using Jenkins?

For one of my projects I am using many dependencies in the form of NuGet packages. When I change any of them, I need to recreate the package and deploy it every time. We currently have Jenkins setup as our task runner. I was wondering is there a way to automate the package creation and deployment as a nightly job for example.

like image 762
Chervenkov Avatar asked Jan 09 '23 10:01

Chervenkov


1 Answers

You can create a new Jenkins job and add a windows batch step. There you can use the following command:

C:\J\Nuget\NuGet_2.81.exe pack “%WORKSPACE%\PhantomTube\PhantomTube.Core\PhantomTube.Core.csproj” –IncludeReferencedProjects  –Version %MajorVersion%.%MinorVersion%.%PatchVersion%%PrereleaseString% -Properties Configuration=Release

You can add some of the parameters as JOB's variables.

You can find more detailed tutorial here: http://automatetheplanet.com/create-jenkins-job-creating-nuget-packages/

like image 124
Anton Angelov Avatar answered Jan 15 '23 12:01

Anton Angelov