|
65 | 65 | artifactName: finalResults |
66 | 66 | downloadPath: '$(System.ArtifactsDirectory)' |
67 | 67 |
|
| 68 | + - task: DownloadBuildArtifacts@0 |
| 69 | + displayName: 'Download PowerShell build artifacts - macosPkgResults' |
| 70 | + inputs: |
| 71 | + buildType: current |
| 72 | + downloadType: single |
| 73 | + artifactName: macosPkgResults |
| 74 | + downloadPath: '$(System.ArtifactsDirectory)' |
| 75 | + |
68 | 76 | - powershell: 'Get-ChildItem $(System.ArtifactsDirectory) -recurse' |
69 | 77 | displayName: 'Capture downloaded artifacts' |
70 | 78 |
|
@@ -188,6 +196,67 @@ jobs: |
188 | 196 | Get-ChildItem "$(System.ArtifactsDirectory)\signed\globaltool" -Recurse |
189 | 197 | displayName: Move global tool packages to subfolder and capture |
190 | 198 |
|
| 199 | + - pwsh: | |
| 200 | + $packagePath = (Join-Path $(System.ArtifactsDirectory) checksum) |
| 201 | + New-Item $packagePath -ItemType Directory -Force > $null |
| 202 | + $srcPaths = @("$(System.ArtifactsDirectory)\finalResults", "$(System.ArtifactsDirectory)\macosPkgResults", "$(System.ArtifactsDirectory)\signed") |
| 203 | +
|
| 204 | + $packages = Get-ChildItem -Path $srcPaths -Include *.zip, *.tar.gz, *.msi*, *.pkg, *.deb, *.rpm -Exclude "PowerShell-Symbols*" -Recurse |
| 205 | + $packages | ForEach-Object { Copy-Item $_.FullName -Destination $packagePath -Verbose } |
| 206 | +
|
| 207 | + $packagePathList = Get-ChildItem $packagePath -Recurse | Select-Object -ExpandProperty FullName | Out-String |
| 208 | + Write-Verbose -Verbose $packagePathList |
| 209 | +
|
| 210 | + Get-ChildItem -Path $packagePath | |
| 211 | + ForEach-Object { |
| 212 | + Write-Verbose -Verbose "Generating checksum file for $($_.FullName)" |
| 213 | + $packageName = $_.Name |
| 214 | + $hash = (Get-FileHash -Path $_.FullName -Algorithm SHA512).Hash.ToLower() |
| 215 | +
|
| 216 | + # the '*' before the packagename signifies it is a binary |
| 217 | + "$hash *$packageName" |
| 218 | + } | |
| 219 | + Out-File -FilePath "$packagePath\SHA512SUMS" -Force |
| 220 | +
|
| 221 | + $fileContent = Get-Content -Path "$packagePath\SHA512SUMS" -Raw | Out-String |
| 222 | + Write-Verbose -Verbose -Message $fileContent |
| 223 | +
|
| 224 | + Copy-Item -Path "$packagePath\SHA512SUMS" -Destination '$(System.ArtifactsDirectory)\signed\' -verbose |
| 225 | + displayName: Generate checksum file for packages |
| 226 | +
|
| 227 | + - pwsh: | |
| 228 | + $packagePath = (Join-Path $(System.ArtifactsDirectory) checksum_gbltool) |
| 229 | + New-Item $packagePath -ItemType Directory -Force > $null |
| 230 | + $srcPaths = @("$(System.ArtifactsDirectory)\signed\globaltool") |
| 231 | + $packages = Get-ChildItem -Path $srcPaths -Include *.nupkg -Recurse |
| 232 | + $packages | ForEach-Object { Copy-Item $_.FullName -Destination $packagePath -Verbose } |
| 233 | +
|
| 234 | + $packagePathList = Get-ChildItem $packagePath -Recurse | Select-Object -ExpandProperty FullName | Out-String |
| 235 | + Write-Verbose -Verbose $packagePathList |
| 236 | +
|
| 237 | + $checksums = Get-ChildItem -Path $packagePath | |
| 238 | + ForEach-Object { |
| 239 | + Write-Verbose -Verbose "Generating checksum file for $($_.FullName)" |
| 240 | + $packageName = $_.Name |
| 241 | + $hash = (Get-FileHash -Path $_.FullName -Algorithm SHA512).Hash.ToLower() |
| 242 | +
|
| 243 | + # the '*' before the packagename signifies it is a binary |
| 244 | + "$hash *$packageName" |
| 245 | + } |
| 246 | +
|
| 247 | + $checksums | Out-File -FilePath "$packagePath\SHA512SUMS" -Force |
| 248 | +
|
| 249 | + $fileContent = Get-Content -Path "$packagePath\SHA512SUMS" -Raw | Out-String |
| 250 | + Write-Verbose -Verbose -Message $fileContent |
| 251 | +
|
| 252 | + Copy-Item -Path "$packagePath\SHA512SUMS" -Destination '$(System.ArtifactsDirectory)\signed\globaltool\' -verbose |
| 253 | + displayName: Generate checksum for global tools |
| 254 | +
|
| 255 | + - template: upload-final-results.yml |
| 256 | + parameters: |
| 257 | + artifactPath: '$(System.ArtifactsDirectory)\checksum' |
| 258 | + artifactFilter: SHA512SUMS |
| 259 | + |
191 | 260 | - task: AzureFileCopy@4 |
192 | 261 | displayName: 'Upload NuGet packages to Azure' |
193 | 262 | inputs: |
|
0 commit comments