PowerShell/tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml
2020-08-13 16:09:50 -07:00

28 lines
1.1 KiB
YAML

steps:
- download: releasePipeline
artifact: finalResults
patterns: "**/*.nupkg"
- download: releasePipeline
artifact: metadata
- 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
$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)"
displayName: Download and capture nupkgs
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Agent.ReleaseDirectory)/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: PowerShellNuGetOrgPush