Skip to content

Azure DevOps YAML CI/CD pipeline which publishes a multi-targeted public NuGet package.

License

Notifications You must be signed in to change notification settings

f2calv/azdo-pipelines-yaml-nuget

Repository files navigation

Publish Multi-Targeted NuGet Package w/Azure DevOps YAML Pipeline

Build Status NuGet Version NuGet

This repository is comprised of three .NET projects, these projects are to help demonstrate the YAML pipeline for publishing the NuGet package;

  • 1 x Class Library (i.e. which is packaged and deployed as a public NuGet package)
  • 1 x Test Project
  • 1 x Console Application (used to test/debug the final package)

The class library multi-targets the following frameworks;

  • .NET Framework 2.7.2
  • .NET Standard 2.0
  • .NET 5.0

The library includes references to both Entity Framework 6 and Entity Framework Core along with some compiler directives as an example of how to create a multi-targeted package.

The CI/CD YAML pipeline is located in the .azure-pipelines directory of the repository.

The pipeline consists of multiple-steps which when combined;

  1. installs key dependencies
  2. handles the semantic versioning of the package
  3. builds all the projects
  4. runs all tests and publishes code coverage report
  5. packs the class library and depending on source branch pushes package to either;

The branching strategy of this repository is GitHubFlow and the pipeline uses GitVersion to control/handle the semantic versioning of each public release. When pushing a new public release (from master) the YAML build pipeline itself is tagged with the current SemVersion and a Tag is added at that commit to provide additional traceability.

Resources;

Additional guidance on including .NET PDB/Symbols and SourceLink;

Unit test & code coverage solution; -https://www.meziantou.net/computing-code-coverage-for-a-dotnet-core-project-with-azure-devops-and-coverlet.htm