1717 - name : branchCounter
1818 value : $[counter(variables['branchCounterKey'], 1)]
1919 - group : DotNetPrivateBuildAccess
20- - group : Azure Blob variable group
2120 - group : ReleasePipelineSecrets
2221 - group : mscodehub-feed-read-general
2322 - group : mscodehub-feed-read-akv
7574 workingDirectory: '$(repoRoot)'
7675 retryCountOnTaskFailure: 2
7776
78- - task : AzurePowerShell@5
79- displayName : Download winverify-private Artifacts
80- inputs :
81- azureSubscription : az-blob-cicd-infra
82- scriptType : inlineScript
83- azurePowerShellVersion : LatestVersion
84- workingDirectory : ' $(repoRoot)'
85- pwsh : true
86- inline : |
87- # download smybols for getfilesiginforedist.dll
88- $downloadsDirectory = '$(Build.ArtifactStagingDirectory)/downloads'
89- $uploadedDirectory = '$(Build.ArtifactStagingDirectory)/uploaded'
90- $storageAccountName = "pscoretestdata"
91- $containerName = 'winverify-private'
92- $winverifySymbolsPath = New-Item -ItemType Directory -Path '$(System.ArtifactsDirectory)/winverify-symbols' -Force
93- $dllName = 'getfilesiginforedist.dll'
94- $winverifySymbolsDllPath = Join-Path $winverifySymbolsPath $dllName
95-
96- $context = New-AzStorageContext -StorageAccountName $storageAccountName -UseConnectedAccount
97-
98- Get-AzStorageBlobContent -Container $containerName -Blob $dllName -Destination $winverifySymbolsDllPath -Context $context
99-
100- - pwsh : |
101- Get-ChildItem -Path '$(System.ArtifactsDirectory)/winverify-symbols'
102- displayName: Capture winverify-private Artifacts
103- workingDirectory: '$(repoRoot)'
104- condition: succeededOrFailed()
105-
10677 - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
10778 displayName : 🔏 CodeQL 3000 Init
10879 condition : eq(variables['CODEQL_ENABLED'], 'true')
@@ -121,23 +92,35 @@ jobs:
12192 Remove-Item -Recurse -Force $OutputFolder/ref
12293 }
12394
124- Copy-Item -Path "$OutputFolder\*" -Destination '$(ob_outputDirectory)' -Recurse -Verbose
95+ $Destination = '$(ob_outputDirectory)'
96+ if (-not (Test-Path $Destination)) {
97+ Write-Verbose -Verbose -Message "Creating destination folder '$Destination'"
98+ $null = mkdir $Destination
99+ }
100+
101+ Copy-Item -Path "$OutputFolder\*" -Destination $Destination -Recurse -Verbose
125102 workingDirectory: '$(repoRoot)'
126103 displayName: 'Build PowerShell Source'
127104
128105 - pwsh : |
129- # Only key windows runtimes
130- Get-ChildItem -Path '$(ob_outputDirectory)\runtimes\*' -File -Recurse | Where-Object {$_.FullName -notmatch '.*\/runtimes\/win'} | Foreach-Object {
106+ # Only keep windows runtimes
107+ Write-Verbose -Verbose -Message "Deleting non-win-x64 runtimes ..."
108+ Get-ChildItem -Path '$(ob_outputDirectory)\runtimes\*' | Where-Object {$_.FullName -notmatch '.*\\runtimes\\win'} | Foreach-Object {
131109 Write-Verbose -Verbose -Message "Deleting $($_.FullName)"
132- Remove-Item -Force -Verbose - Path $_.FullName
110+ Remove-Item -Path $_.FullName -Recurse -Force
133111 }
134112
135- # Temporarily remove runtimes/win-x64 due to issues with that runtime
136- Get-ChildItem -Path '$(ob_outputDirectory)\runtimes\*' -File -Recurse | Where-Object {$_.FullName -match '.*\/runtimes\/win-x86\/'} | Foreach-Object {
113+ # Remove win-x86/arm/arm64 runtimes due to issues with those runtimes
114+ Write-Verbose -Verbose -Message "Temporarily deleting win-x86/arm/arm64 runtimes ..."
115+ Get-ChildItem -Path '$(ob_outputDirectory)\runtimes\*' | Where-Object {$_.FullName -match '.*\\runtimes\\win-(x86|arm)'} | Foreach-Object {
137116 Write-Verbose -Verbose -Message "Deleting $($_.FullName)"
138- Remove-Item -Force -Verbose - Path $_.FullName
117+ Remove-Item -Path $_.FullName -Recurse -Force
139118 }
140119
120+ Write-Host
121+ Write-Verbose -Verbose -Message "Show content in 'runtimes' folder:"
122+ Get-ChildItem -Path '$(ob_outputDirectory)\runtimes'
123+ Write-Host
141124 workingDirectory: '$(repoRoot)'
142125 displayName: 'Remove unused runtimes'
143126
0 commit comments