Do not push nupkg artifacts to myget (#14613)

This commit is contained in:
James Truher [MSFT] 2021-01-14 21:46:24 -08:00 committed by GitHub
parent e26d7084e2
commit 073bf28e9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 26 deletions

View file

@ -30,5 +30,5 @@ jobs:
- pwsh: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
Invoke-CIFinish -NuGetKey $(NUGET_KEY)
Invoke-CIFinish
displayName: Build and Test Package

View file

@ -437,13 +437,9 @@ function Get-ReleaseTag
# Implements CI 'on_finish' step
function Invoke-CIFinish
{
param(
[string] $NuGetKey
)
if($PSEdition -eq 'Core' -and ($IsLinux -or $IsMacOS))
{
return New-LinuxPackage -NugetKey $NugetKey
return New-LinuxPackage
}
try {
@ -537,12 +533,6 @@ function Invoke-CIFinish
$pushedAllArtifacts = $false
Write-Warning "Artifact $_ does not exist."
}
if($NuGetKey -and $env:NUGET_URL -and [system.io.path]::GetExtension($_) -ieq '.nupkg')
{
Write-Log "pushing $_ to $env:NUGET_URL"
Start-NativeExecution -sb {dotnet nuget push $_ --api-key $NuGetKey --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
}
}
if(!$pushedAllArtifacts)
{
@ -692,10 +682,6 @@ function Invoke-LinuxTestsCore
function New-LinuxPackage
{
param(
[string]
$NugetKey
)
$isFullBuild = Test-DailyBuild
$releaseTag = Get-ReleaseTag
@ -716,16 +702,6 @@ function New-LinuxPackage
Write-Error -Message "Package NOT found: $package"
}
# 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($isFullBuild -and $NugetKey -and $env:NUGET_URL -and [system.io.path]::GetExtension($package) -ieq '.nupkg')
{
Write-Log "pushing $package to $env:NUGET_URL"
Start-NativeExecution -sb {dotnet nuget push $package --api-key $NugetKey --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
}
if($isFullBuild)
{
if ($package -isnot [System.IO.FileInfo])