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?
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