1

My Azure Pipelines build outputs NuGet packages in the /home/vsts/work/1/Windows folder where Windows is a matrix name (I'm running the build section of my pipeline on Windows, Mac and Linux but want to publish the NuGet packages only from my Windows build).

The docs talk about using the $(Build.ArtifactStagingDirectory)/*.nupkg path to pass to NuGetCommand@2. However, this points to the /home/vsts/work/1/a folder.

Is the $(Build.ArtifactStagingDirectory) variable wrong because I'm using a matrix build? Is it wrong because I'm using the PublishPipelineArtifact@0 task to publish my .nupkg's?

Here is a link to my azure-pipelines.yml file.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311

1 Answers1

2

Because you're using the matrix strategy with PublishArtifacts, you have multiple artifacts, so in the second stage (the deployment stage) the 3 artifacts are downloaded not to folder a in the agent, but to the root build folder:

    home
    |-- vsts
      |-- work
        |-- 1
          |-- a
              b
              s
              Test Results
              Mac
              Ubuntu
              Windows

So you need to combine the variable $(Build.BuildDirectory) (home/vsts/work/1) with /Windows/.nupkg, like so:

$(Build.BuildDirectory)/Windows/.npukg
mech
  • 2,775
  • 5
  • 30
  • 38
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114