Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing our inclusion of -Verbose here, makes me think it would be really nice if we just had a variable we could set to make the whole build spit out verbose PowerShell output. But it does also make sense as a default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting all verbose can be too much sometimes. Specially with import-module etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its more for logging what gets copied to where.


$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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -41,3 +43,4 @@ jobs:
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: ps-deps-json
blobPrefix: '$(BlobPrefix)'