azure devops publishing to skip when a package already exist
You can use NugetCommand@2's allowPackageConflicts and set it to true to avoid breaking the pipeline when there's an existing package. An example can be shown here
- task: NuGetCommand@2 displayName: 'NuGet push' inputs: command: push publishVstsFeed: '<projectName>/<feed>' allowPackageConflicts: true
Alternatively you can also use dotnet command --skip-duplicate:
- script: dotnet nuget push **/*.nupkg --source $(NUGET_FEED) --api-key $(NUGET_API_KEY) --skip-duplicate
displayName: 'Uploads nuGet packages'
Comments