Only push to NuGet for Full Build (cron) (#4517)

This commit is contained in:
Travis Plunk 2017-08-11 08:50:04 -07:00 committed by GitHub
parent 0bfee35525
commit b3ebdafccd

View File

@ -183,7 +183,11 @@ else
$packages += Start-PSPackage @packageParams -Type AppImage
foreach($package in $packages)
{
if($env:NUGET_KEY -and $env:NUGET_URL -and [system.io.path]::GetExtension($package) -ieq '.nupkg')
# Publish the packages to the nuget feed if:
# 1 - It's a Daily build (already checked, for not a PR)
# 2 - We have the info to publish (NUGET_KEY and NUGET_URL)
# 3 - it's a nupkg file
if($isDailyBuild -and $env:NUGET_KEY -and $env:NUGET_URL -and [system.io.path]::GetExtension($package) -ieq '.nupkg')
{
log "pushing $package to $env:NUGET_URL"
Start-NativeExecution -sb {dotnet nuget push $package --api-key $env:NUGET_KEY --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode