This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11197|Reply: 0

Azure DevOps 2020 (V) Automate the release of NUGET packages using Pipelines

[Copy link]
Posted on 2020-9-10 14:05:33 | | | |
Azure DevOps 2020 (1) First Introduction to Microsoft Azure DevOps (TFS)
https://www.itsvse.com/thread-9239-1-1.html

Azure DevOps 2020 (II) Azure DevOps Server Express 2020 RC2 installation tutorial
https://www.itsvse.com/thread-9375-1-1.html

Azure DevOps 2020 (III) limits search (ES) memory footprint
https://www.itsvse.com/thread-9371-1-1.html

Azure DevOps 2020 (IV) Compiled jobs using Pipelines
https://www.itsvse.com/thread-9378-1-1.html

Azure Pipelines is a cloud service that you can use to automatically build and test your code projects and make them available to other users. It works in almost any language or project type.

Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to continuously test and build your code and deliver it to any target.

You can use multiple languages in Azure Pipelines, such as Python, Java, JavaScript, PHP, Ruby, C#, C++, and Go.

This article explains howUse Azure DevOps Pipelines to automate the release of nuget packages to private repositories

Create a new project in Azure DevOps with the name: dotnet-pull-nuget (the name is wrong, it doesn't matter)



Use VS 2019 to create a new .NET Core 3.1 library project named dotnet-pull-nuget

Add the project to the source manager, that is, check in to the Azure DevOps repository, click on Team Explorer, select "Manage Connection" at the top, enter our private Azure DevOps address, and enter the account and password.


Create a new pipeline project with YAML syntax, select "Azure Repos Git" in the code, and the yml configuration file is as follows:

The function of this build pipeline is that whenever we have a code update (Push) to the remote master branch, it will automatically be used to automatically build, (automatic testing, skipped here), and automatically package and generate Artifacts for later automatic deployment pipelines.

You can manually trigger the execution of the pipeline by clicking "Run Pipeline" in the upper right corner, the following is the execution history of my execution, as shown in the figure below:



You can click on a certain item and then click on the job to view the execution, as shown in the figure below:



Click Pipelines -> Publish -> to create a new release pipeline, stage 1, and select an empty job.



Click View Stage Tasks to go to the Tasks tab page, as shown below:



Add a nuget task as shown below:



Select push, the path to the nuget package to be published, and fill in the following information:

Click the New button to the right of NuGet Server to add our private NuGet repository address, as shown below:



Enter the source URL and ApiKey, as shown in the following image:



For variables, see:The hyperlink login is visible.

For information on how to set up a private NuGet repository, see:https://www.itsvse.com/thread-9380-1-1.html

The complete configuration is shown below:



The YAML format is configured as follows:
The source alias is set according to the release name information of the new pipeline at the beginning, and the project configuration is as follows:



You can set a continuous deployment trigger, that is, after we submit the code to check in, the pipeline will be executed, and then the release task will be triggered, as shown in the figure below:



Click Save in the upper right corner to create a post.



You can see that our nuget package was successfully pushed to the private repository.



The release history and execution status are shown in the following figure:



After the release is successful, open the private Nuget repository address and you can see the latest package we pushed, as shown in the figure below:



We can add our private NuGet repository address through the NuGet package manager, package source, as shown in the figure below:



Nuget updates can also be viewed through the VS tool, as shown below:



(End)




Previous:Nuget Series 2 uses BaGet to build private Nuget services
Next:Azure DevOps 2020 (VI) Upgrade NuGet tools
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com