Skip to content

Commit

Permalink
ci: use proper sha256 file format and avoid overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
leafspark committed Aug 23, 2024
1 parent bb6f0ef commit bfd12bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,18 @@ jobs:
$archSuffix = if ("${{ matrix.arch }}" -eq "x86") { "-x86" } else { "-x64" }
$exeName = "AutoGGUF$archSuffix.exe"
$versionHash = "${{ github.sha }}".Substring(0, 7)
$hashFile = "AutoGGUF-$versionHash.sha256"
Get-FileHash "$distPath\$exeName" -Algorithm SHA256 | Select-Object -ExpandProperty Hash | Out-File -FilePath "$distPath\$hashFile"
$hashFile = "AutoGGUF-${{ matrix.os }}-${{ matrix.arch }}-$versionHash.sha256"
$hash = (Get-FileHash "$distPath\$exeName" -Algorithm SHA256).Hash.ToLower()
"$hash *$exeName" | Out-File -FilePath "$distPath\$hashFile" -Encoding utf8
- name: Generate SHA256 (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
distPath=$(if [ "${{ github.event.inputs.build_type }}" = "RELEASE" ]; then echo "build/release/dist"; else echo "build/dev/dist"; fi)
exeName="AutoGGUF-x64"
versionHash=$(echo ${{ github.sha }} | cut -c1-7)
hashFile="AutoGGUF-$versionHash.sha256"
sha256sum "$distPath/$exeName" | awk '{print $1}' > "$distPath/$hashFile"
hashFile="AutoGGUF-${{ matrix.os }}-x64-$versionHash.sha256"
cd $distPath && sha256sum $exeName > $hashFile
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit bfd12bb

Please sign in to comment.