Nuget Pipeline for multi-project repo

15 views Asked by At

I have a repo with multiple projects in it with a dependency structure similar to below:

ProjectA

  • Dependencies:
    • ProjectB

ProjectB

  • Dependencies: (None)

ProjectC

  • Dependencies:
    • ProjectB

ProjectD

  • Dependencies:
    • ProjectA
    • ProjectB
    • ProjectC

I want to create a build pipeline in DevOps so that when a pull request is completed into the master branch, DevOps artifacts are created for all these projects and all the artifacts created reference the new artifacts versions.

For example, if the artifact versions are all 1.0.0 and a pull request is accepted, the artifact for ProjectD would reference artifact version 1.0.1 for projects A, B, and C.

For further visualization of the repo structure, I tried creating a repo structure similar to EntityFrameworkCore: https://github.com/dotnet/efcore/tree/main/src

When developing, I have all the projects referencing each other via project reference. But obviously when creating the artifacts I want them to be package references... I don't know how to make that change only when building the artifacts?

The only thing I can think of is in the .csproj, I could conditionally reference PackageReference when in release but ProjectReference when in debug? But How would I reference the new versions, which wouldn't have been created at the time of building it within the pipeline?

0

There are 0 answers