From 62fa8cc12fc3bff1558e00881d52f3173433819d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:15:15 +0000 Subject: [PATCH] Add SHA256 hash generation for ZIP archives in nightly and release builds Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- scripts/nightly.yaml | 11 ++++++++++- scripts/release.yml | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 932fc778e..a8fae30b2 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -358,7 +358,7 @@ stages: displayName: 'Download Win32 Build' inputs: artifactName: 'WindowsBuild-x86' - targetPath: $(Agent.TempDirectory) + targetPath: $(Agent.TempDirectory) - task: DownloadPipelineArtifact@2 displayName: 'Download ManyLinux Build' inputs: @@ -452,6 +452,15 @@ stages: inputs: artifactName: 'NuGet32' targetPath: tmp + - script: | + cd tmp + for file in *.zip; do + if [ -f "$file" ]; then + sha256sum "$file" > "$file.sha256" + echo "Generated SHA256 for $file" + fi + done + displayName: 'Generate SHA256 hashes for ZIP files' - task: GitHubRelease@1 continueOnError: true inputs: diff --git a/scripts/release.yml b/scripts/release.yml index 946b002f3..3a3979782 100644 --- a/scripts/release.yml +++ b/scripts/release.yml @@ -448,12 +448,22 @@ stages: displayName: 'Download NuGet64 Package' inputs: artifact: 'NuGet' - path: $(Agent.TempDirectory) + path: $(Agent.TempDirectory) - task: DownloadPipelineArtifact@2 displayName: 'Download NuGet32 Package' inputs: artifact: 'NuGet32' - path: $(Agent.TempDirectory) + path: $(Agent.TempDirectory) + - powershell: | + $files = Get-ChildItem -Path "$(Agent.TempDirectory)" -Filter "*.zip" + foreach ($file in $files) { + $hash = Get-FileHash -Path $file.FullName -Algorithm SHA256 + $hashString = $hash.Hash.ToLower() + " " + $file.Name + $hashFile = $file.FullName + ".sha256" + Set-Content -Path $hashFile -Value $hashString + Write-Host "Generated SHA256 for $($file.Name)" + } + displayName: 'Generate SHA256 hashes for ZIP files' - task: GitHubRelease@1 inputs: gitHubConnection: Z3Prover