0

I have the following configured Azure DevOps pipeline which is building the Windows version of the Xamarin App, was going to try and get that one working first and the build works, but I'm getting an error in the publish, path not found, the 2 paths look fine but I guess this is down to me not building one of these before.

Build step which works fine enter image description here

Publish artifact step which fails enter image description here

The error that I get is as follows

enter image description here

Still trying to work out what I have got wrong, so I will keep going at it but if anyone has any hints would be greatly apprecaited.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • You may try to build all your path first. By the way, may I know if you have used PublishPipelineArtifact@0 task. – Hongxin Sui-MSFT Sep 08 '22 at 06:09
  • You could try to create the folder first using a `powershell`. For example `New-Item -ItemType Directory -Force -Path "$(Build.ArtifactStagingDirectory)/AppxPackages"` – GeralexGR Sep 08 '22 at 07:11
  • Don't post screenshots of error messages, post the actual error text. Screenshots make the site inaccessible to visually impaired users (including, in this case, the colorblind -- red on black text is *very* hard for some people to read... myself included) – Daniel Mann Sep 08 '22 at 17:15
  • @HongxinSui-MSFT I was actually using a sample article I found on Microsoft docs and it used the classic style pipeline, I'll read up about the PublishPipelineArtifact@0 this is jus the "Publish artifact: drop" task in the classic pipeline builder – Michael Pine Sep 08 '22 at 21:33
  • Actual error text attached here – Michael Pine Sep 08 '22 at 21:34
  • '##[debug]StoreAsTar=false ##[debug]PathtoPublish=D:\a\1\a\AppxPackages ##[debug]check path : D:\a\1\a\AppxPackages ##[debug]task result: Failed ##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\a\AppxPackages ##[debug]Processed: ##vso[task.issue type=error;]Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\a\AppxPackages ##[debug]Processed: ##vso[task.complete result=Failed;]Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\a\AppxPackages ' – Michael Pine Sep 08 '22 at 21:37
  • You may use the PublishPipelineArtifact@0 task instead of the deprecated PublishBuildArtifacts@1. For more details, please refer to the website:"https://stackoverflow.com/questions/50719178/publishing-build-artifacts-failed-with-an-error-not-found-pathtopublish-d-a-1" – Hongxin Sui-MSFT Sep 09 '22 at 01:28
  • So I created a new YAML pipeline and copied out all of the previous steps that worked ok, realized I had to use NuGet 4.4.1 if I use a different version that fails but I copied all that in and then copied in your suggestions using the PublishPipelineArtifact@0 and I modified the variable from the answer in the other thread because the variable names are slightly different case sensitivity and now the build pipeline builds all the way, thanks very much for the suggestions – Michael Pine Sep 12 '22 at 00:31

1 Answers1

0

This thread as posted by Hongxin Sui was the solution for me, this is the thread. Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\s\$(buildStagingDirectory)

However, what I did need to do was create a new YAML pipeline and I copied all the working steps in from the previous classic pipeline, I used the "Copy YAML" functionality and then I used the different Task as stated in that thread. Just make sure you change the case of the "Build" and "ArtifactStaging.." variable names as they need to be lower case not upper case.