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

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type