I am trying to publish artifacts after building our .Net MAUI app on Azure Devops pipeline. It works when I do it like this:
- task: PublishBuildArtifact@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/'
ArtifactName: 'drop'
publishLocation: 'Container'
After the pipeline runs, expected artifacts are created.
But I read that “PublishBuildArtfact” task is basically deprecated, and I should be using the “PublishPipelineArtifact” task. I tried to replace it as this:
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: drop'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/'
ArtifactName: 'drop'
artifactType: 'pipeline'
But no artifacts are created. What am I missing?