Skip to content

Commit

Permalink
Tweak build pipeline to push allowing skipping duplicate package numb…
Browse files Browse the repository at this point in the history
…ers. (#16)
  • Loading branch information
CZEMacLeod authored Aug 21, 2023
1 parent a50c184 commit c25d349
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,23 @@ steps:
PACKAGES_DIR: $(Build.ArtifactStagingDirectory)
NUGET_CONFIG: $(Build.ArtifactStagingDirectory)\nuget.publish.config

- task: NuGetCommand@2
- script: nuget.exe sources Add -NonInteractive -Name NuGet -Source "https://api.nuget.org/v3/index.json" -ConfigFile %NUGET_CONFIG%
displayName: Add nuget.org package source
env:
NUGET_CONFIG: $(Build.ArtifactStagingDirectory)\nuget.publish.config

- script: nuget.exe setapikey %NUGET_API_KEY% -Source "https://api.nuget.org/v3/index.json" -ConfigFile %NUGET_CONFIG%
displayName: Set nuget.org apikey
env:
NUGET_API_KEY: $(NUGET_API_KEY)
NUGET_CONFIG: $(Build.ArtifactStagingDirectory)\nuget.publish.config

- script: nuget push -Source NuGet -ConfigFile %NUGET_CONFIG% -SkipDuplicate "%PACKAGES_DIR%\*.nupkg"
displayName: Push Nuget Packages to nuget.org
condition: and(succeeded(), ne(variables['package_count'],0))
inputs:
command: 'push'
feedsToUse: 'config'
includeNugetOrg: true
publishFeedCredentials: 'NuGet.org'
externalFeedCredentials: 'NuGet.org'
packagesToPush: $(Build.ArtifactStagingDirectory)\*.nupkg
verbosityPush: 'Detailed'
nuGetFeedType: 'external'
allowPackageConflicts: true
env:
PACKAGES_DIR: $(Build.ArtifactStagingDirectory)
NUGET_CONFIG: $(Build.ArtifactStagingDirectory)\nuget.publish.config

- powershell: |
Write-Host "Tagging Build: $env:BuildNumber"
Expand Down

0 comments on commit c25d349

Please sign in to comment.