Azure Pipelines: "No packages matched the search pattern."

I am writing a YAML pipeline that should publish a NuGet package.

When coming to the deployment job I get a warning: "No packages matched the search pattern." The package is there and it is confirmed by the log

Downloaded drop/PackageName.1.0.0.nupkg to d:\a\1\drop\PackageName.1.0.0.nupkg

and the variable packagesToPush is set to **/*.nupkg;!**/*.symbols.nupkg.

What am I missing here?

I also tried with different folders like $(Build.ArtifactgDirectory)/**/*.nupkg;!$(Build.ArtifactDirectory)/**/*.symbols.nupkg


You should use $(System.DefaultWorkingDirectory) instead of $(Build.ArtifactgDirectory).

$(System.DefaultWorkingDirectory)/**/*.nupkg;!$(System.DefaultWorkingDirectory)/**/*.symbols.nupkg