2
votes

On Azure DevOps, I have some files I want to publish:

  • $(Build.ArtifactStagingDirectory)/dist/app/index.html
  • $(Build.ArtifactStagingDirectory)/dist/app/bundle.js

I want to publish them into an artifact app.zip which contains, at the root level: - index.html - bundle.js

However when I use the "Publish Build Artifacts" tasks with the path set to $(Build.ArtifactStagingDirectory)/dist/app, I get the following contents in app.zip:

  • app/
    • index.html
    • bundle.js

I tried setting the publish path to:

  • $(Build.ArtifactStagingDirectory)/dist/app/**
  • $(Build.ArtifactStagingDirectory)/dist/app/*
  • $(Build.ArtifactStagingDirectory)/dist/app/*.*

but all of these fail the build with the error Not found PathtoPublish

1

1 Answers

0
votes

if I understand your question , you trying to publish 2 files as your atficats. as you are already ready with app.zip may be first retry copying it to another staging folder and then try to copy it from there. or see the below pattern to traverse through the directories. then you need - task: PublishBuildArtifacts inputs:

 pathtoPublish: $(Build.ArtifactStagingDirectory)/**/*
artifactName: MyBuildOutputs

Cheers. AJ