Here simple steps to follow and create new Automated Build using Azure DevOps to push your DLLs into NuGet Repository 
You mainly needed three task to Restore, Pack and Push library into NuGet repository.
Go to Pipeline > Build > Create New Build , Add following Task on your build 
- Get
     a Sources
 - Choose
      Repository (TFVC or Git)
 - Add
     Agent Job
 - NuGet
      Tool Installer : leave all default
 
                                                   
i.     Type:
Map
                                                  
ii.     Server
Path: choose source code location
                                                 
iii.     Clean:
true
                                                 
iv.     Clean
Options: sources
                                                  
v.     Label
sources: OnSuccess
                                                 
vi.     Label
format: $(Build.BuildNumber)
- NuGet  for Restore
 
                                                   
i.     Choose
command : restore
                                                  
ii.     Path to solution, packages.config, or project.json (.sln file
path)
                               iii.     Use packages from this Azure Artifacts/TFS feed
                                iv.     Check: Use packages from NuGet.org
- Update
      AssemblyInfo
 
                                                   
i.     Root
Folder: $(Build.SourcesDirectory)
                                                  
ii.     File
pattern (AssemblyInfo.cs)
                                                 
iii.     Version:
$(Build.BuildNumber)
                                                 
iv.     File
Version: $(Build.BuildNumber)
- Visual
      Studio Build
 
                                                   
i.     Solution
:   .sln file path
                                                  
ii.     Visual
Studio Version: Latest
                                                 
iii.     Platform
: AnyCPU
                                                 
iv.     Configuration:
Release
                                                  
v.     Check:
Clean
- NuGet
      (for pack)
 
                                                   
i.     Command:
pack
                                                  
ii.     Path
for proj or nuspec
                                                 
iii.     Pack
Option: “Use the build number”
- NuGet
      (for Push)
 
                                                   
i.     Command
: push
                                                  
ii.     Path
to NuGet package to publish ($(Build.ArtifactStagingDirectory)/*.nupkg)
                                                 
iii.     Target
Feed: “Select a feed hosted in this account. You must
have Package Management installed and licensed to select a feed here.”
Go to this video for more details 
No comments:
Post a Comment