3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-05 02:40:24 +00:00

Restrict SHA256 hash generation to source code archives only

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-07-11 16:23:40 +00:00
parent 62fa8cc12f
commit 6d1baffe16
2 changed files with 17 additions and 15 deletions

View file

@ -454,13 +454,13 @@ stages:
targetPath: tmp
- script: |
cd tmp
for file in *.zip; do
if [ -f "$file" ]; then
for file in z3-*.zip; do
if [ -f "$file" ] && [[ "$file" == *"$(Build.SourceVersion)"* ]]; then
sha256sum "$file" > "$file.sha256"
echo "Generated SHA256 for $file"
echo "Generated SHA256 for source code archive: $file"
fi
done
displayName: 'Generate SHA256 hashes for ZIP files'
displayName: 'Generate SHA256 hashes for source code archives'
- task: GitHubRelease@1
continueOnError: true
inputs:

View file

@ -249,7 +249,7 @@ stages:
displayName: 'Download Ubuntu ARM64 Build'
inputs:
artifact: 'UbuntuArm64'
path: $(Agent.TempDirectory)\package
path: $(Agent.TempDirectory)\package
- task: DownloadPipelineArtifact@2
displayName: 'Download macOS Build'
inputs:
@ -359,7 +359,7 @@ stages:
displayName: 'Download Win64 Build'
inputs:
artifact: 'WindowsBuild-x64'
path: $(Agent.TempDirectory)
path: $(Agent.TempDirectory)
- task: DownloadPipelineArtifact@2
displayName: 'Download ManyLinux Build'
inputs:
@ -423,7 +423,7 @@ stages:
displayName: 'Download macOSArm64 Build'
inputs:
artifact: 'MacArm64'
path: $(Agent.TempDirectory)
path: $(Agent.TempDirectory)
- task: DownloadPipelineArtifact@2
displayName: 'Download Win32 Build'
inputs:
@ -438,7 +438,7 @@ stages:
displayName: 'Download Arm64 Build'
inputs:
artifact: 'WindowsBuild-arm64'
path: $(Agent.TempDirectory)
path: $(Agent.TempDirectory)
- task: DownloadPipelineArtifact@2
displayName: "Download Python"
inputs:
@ -455,15 +455,17 @@ stages:
artifact: 'NuGet32'
path: $(Agent.TempDirectory)
- powershell: |
$files = Get-ChildItem -Path "$(Agent.TempDirectory)" -Filter "*.zip"
$files = Get-ChildItem -Path "$(Agent.TempDirectory)" -Filter "z3-*.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)"
if ($file.Name -like "*$(Build.SourceVersion)*") {
$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 source code archive: $($file.Name)"
}
}
displayName: 'Generate SHA256 hashes for ZIP files'
displayName: 'Generate SHA256 hashes for source code archives'
- task: GitHubRelease@1
inputs:
gitHubConnection: Z3Prover