A few fixes to the release pipeline (#13473)

This commit is contained in:
Aditya Patwardhan 2020-08-18 15:47:56 -07:00 committed by GitHub
parent 904e551178
commit 1e940f55b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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)'