mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
pass nugetkey as param (#8461)
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ jobs:
|
||||
|
||||
- powershell: |
|
||||
$ErrorActionPreference = 'continue'
|
||||
tools/travis.ps1
|
||||
tools/travis.ps1 -NugetKey $(NUGET_KEY)
|
||||
displayName: Build and test
|
||||
condition: succeeded()
|
||||
|
||||
|
||||
@@ -94,6 +94,6 @@ steps:
|
||||
- powershell: |
|
||||
Import-Module .\tools\Appveyor.psm1
|
||||
Restore-PSOptions
|
||||
Invoke-AppveyorFinish
|
||||
Invoke-AppveyorFinish -NuGetKey $(NUGET_KEY)
|
||||
displayName: Finish
|
||||
condition: eq(variables['Purpose'], 'ElevatedPesterTests_xUnit_Packaging')
|
||||
|
||||
+6
-2
@@ -579,6 +579,10 @@ function Get-ReleaseTag
|
||||
# Implements AppVeyor 'on_finish' step
|
||||
function Invoke-AppveyorFinish
|
||||
{
|
||||
param(
|
||||
[string] $NuGetKey
|
||||
)
|
||||
|
||||
try {
|
||||
$releaseTag = Get-ReleaseTag
|
||||
|
||||
@@ -664,10 +668,10 @@ function Invoke-AppveyorFinish
|
||||
Write-Warning "Artifact $_ does not exist."
|
||||
}
|
||||
|
||||
if($env:NUGET_KEY -and $env:NUGET_URL -and [system.io.path]::GetExtension($_) -ieq '.nupkg')
|
||||
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 $env:NUGET_KEY --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
|
||||
Start-NativeExecution -sb {dotnet nuget push $_ --api-key $NuGetKey --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
|
||||
}
|
||||
}
|
||||
if(!$pushedAllArtifacts)
|
||||
|
||||
+4
-3
@@ -2,7 +2,8 @@
|
||||
# Licensed under the MIT License.
|
||||
param(
|
||||
[ValidateSet('Bootstrap','Build','Failure','Success')]
|
||||
[String]$Stage = 'Build'
|
||||
[String]$Stage = 'Build',
|
||||
[String]$NugetKey
|
||||
)
|
||||
|
||||
Import-Module $PSScriptRoot/../build.psm1 -Force
|
||||
@@ -362,10 +363,10 @@ elseif($Stage -eq 'Build')
|
||||
# 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')
|
||||
if($isDailyBuild -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 $env:NUGET_KEY --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
|
||||
Start-NativeExecution -sb {dotnet nuget push $package --api-key $NugetKey --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
|
||||
}
|
||||
}
|
||||
if ($IsLinux)
|
||||
|
||||
Reference in New Issue
Block a user