mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 17:53:58 +08:00
A few fixes to the release pipeline (#13473)
This commit is contained in:
parent
904e551178
commit
1e940f55b1
@ -8,20 +8,21 @@ steps:
|
||||
|
||||
- pwsh: |
|
||||
#Exclude all global tool packages. Their names start with 'PowerShell.'
|
||||
Copy-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Exclude "PowerShell.*.nupkg" -Force
|
||||
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
|
||||
Copy-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Exclude "PowerShell.*.nupkg" -Force -Verbose
|
||||
|
||||
$releaseVersion = Get-Content "$ENV:PIPELINE_WORKSPACE/releasePipeline/metadata/release.json" | ConvertFrom-Json | Select-Object -ExpandProperty 'ReleaseVersion'
|
||||
$globalToolPath = "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/PowerShell.$releaseVersion.nupkg"
|
||||
### -WhatIf to make sure we do not release global tool. Remove -WhatIf when the PowerShell name reservation is done.
|
||||
Copy-Item $globalToolPath -Destination "$(Pipeline.Workspace)/release" -WhatIf
|
||||
|
||||
Get-ChildItem "$(Pipeline.Workspace)"
|
||||
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
|
||||
displayName: Download and capture nupkgs
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'NuGet push'
|
||||
inputs:
|
||||
command: push
|
||||
packagesToPush: '$(Agent.ReleaseDirectory)/*.nupkg'
|
||||
packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
|
||||
nuGetFeedType: external
|
||||
publishFeedCredentials: PowerShellNuGetOrgPush
|
||||
|
@ -20,16 +20,18 @@ jobs:
|
||||
throw "Unexpected fileName: $fileName"
|
||||
}
|
||||
|
||||
$vstsCommand = "vso[task.setvariable variable=ContainerName]$fileName"
|
||||
$vstsCommand = "vso[task.setvariable variable=BlobPrefix]$fileName"
|
||||
Write-Verbose -Verbose $vstsCommand
|
||||
Write-Host "##$vstsCommand"
|
||||
displayName: Determine container name
|
||||
|
||||
- pwsh: |
|
||||
$zipFile = (Get-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/PowerShell*-winx64.zip")
|
||||
$zipFile = (Get-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/PowerShell*-win-x64.zip")
|
||||
Expand-Archive -Path $zipFile -Destination "$ENV:PIPELINE_WORKSPACE/expanded"
|
||||
|
||||
$pwshDepsFile = Get-Item "$ENV:PIPELINE_WORKSPACE/expanded/pwsh.deps.json"
|
||||
$vstsCommand = "vso[task.setvariable variable=FileToUpload]$pwshDepsFile"
|
||||
Write-Verbose -Verbose $vstsCommand
|
||||
Write-Host "##$vstsCommand"
|
||||
displayName: Determine file to upload
|
||||
|
||||
@ -41,3 +43,4 @@ jobs:
|
||||
Destination: AzureBlob
|
||||
storage: '$(StorageAccount)'
|
||||
ContainerName: ps-deps-json
|
||||
blobPrefix: '$(BlobPrefix)'
|
||||
|
Loading…
Reference in New Issue
Block a user