MyGet - NuGet/dotnet pipelines sample

This project contains an example of building, packaging and publishing a .NET Core library to MyGet using Bitbucket Pipelines. Once published to MyGet, the package can be used in other projects using the NuGet package manager.

Want to learn more? Here's a full write-up on how a .NET Core build would work.

The pipelines configuration:

  • Uses the .NET Core Docker image
  • Generates a buld number that is suffixed to the library package version
  • Runs the following commands:
    • dotnet restore
    • dotnet build
    • dotnet test (optional, disabled by default)
    • dotnet pack
    • Publishes the package to a MyGet feed

Before being able to invoke the Bitbucket pipeline, there are a couple of environment variables to be configured:

  • MYGET_NUGET_URL: The full URL of the NuGet feed on MyGet (e.g.
  • BUILD_CONFIGURATION: Build configuration (Debug/Release)