Skip to content
Merged
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
29 changes: 28 additions & 1 deletion tools/releaseBuild/azureDevOps/templates/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,35 @@ jobs:
Write-Verbose -Verbose -Message $fileContent

Copy-Item -Path "$packagePath\SHA512SUMS" -Destination '$(System.ArtifactsDirectory)\signed\' -verbose
displayName: Generate checksum file for packages

- pwsh: |
$packagePath = (Join-Path $(System.ArtifactsDirectory) checksum_gbltool)
New-Item $packagePath -ItemType Directory -Force > $null
$srcPaths = @("$(System.ArtifactsDirectory)\signed\globaltool")
$packages = Get-ChildItem -Path $srcPaths -Include *.nupkg -Recurse
$packages | ForEach-Object { Copy-Item $_.FullName -Destination $packagePath -Verbose }

$packagePathList = Get-ChildItem $packagePath -Recurse | Select-Object -ExpandProperty FullName | Out-String
Write-Verbose -Verbose $packagePathList

$checksums = Get-ChildItem -Path $packagePath |
ForEach-Object {
Write-Verbose -Verbose "Generating checksum file for $($_.FullName)"
$packageName = $_.Name
$hash = (Get-FileHash -Path $_.FullName -Algorithm SHA512).Hash.ToLower()

# the '*' before the packagename signifies it is a binary
"$hash *$packageName"
}

$checksums | Out-File -FilePath "$packagePath\SHA512SUMS" -Force

$fileContent = Get-Content -Path "$packagePath\SHA512SUMS" -Raw | Out-String
Write-Verbose -Verbose -Message $fileContent

Copy-Item -Path "$packagePath\SHA512SUMS" -Destination '$(System.ArtifactsDirectory)\signed\globaltool\' -verbose
displayName: Generate checksum file
displayName: Generate checksum for global tools

- template: upload-final-results.yml
parameters:
Expand Down