Reputation: 23
My code for the azure pipeline
I have Problems using the azure pipeline, which will automatically pack my libraries on azure devops git and push it as a nugetpackage to artifacts.
I get the error ##[error]No packages matched the search pattern. at dotnet push
Until that step everything works. I want to pack it as a nuget so i can use it in other projects. Its a API Client i wrote for my own API.
Upvotes: 1
Views: 2468
Reputation: 24312
Try using the artifact path from artifact staging directory
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
arguments: '--configuration $(buildConfiguration)'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: "dotnet pack"
inputs:
command: 'pack'
arguments: '--configuration $(buildConfiguration)'
packagesToPack: '**/*.csproj'
nobuild: true
versioningScheme: 'off'
- task: NuGetCommand@2
displayName: 'nuget push'
inputs:
command: 'push'
feedsToUse: 'select'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '<Name of Your Feed>'
versioningScheme: 'off'
allowPackageConflicts: true
Upvotes: 1
Reputation: 40603
Please add to dotnet pack
for instance setting like this to your inputs:
packDirectory: "$(Build.ArtifactStagingDirectory)/packages"
And then to dotnet push
setting like this:
packagesToPush: '$(Build.ArtifactStagingDirectory)/packages/*.*nupkg'
In your approach it simply try to find packages in defualt folder but you didn't put packages there.
Upvotes: 0