Skip to content

Commit

Permalink
ci: add sha256 generation support to build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
leafspark committed Aug 23, 2024
1 parent a97a545 commit bb6f0ef
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,35 @@ jobs:
cp src/convert_lora_to_gguf.py $distPath/src/
cp src/convert_lora_to_ggml.py $distPath/src/
- name: Generate SHA256 (Windows)
if: matrix.os == 'windows-latest'
run: |
$distPath = if ("${{ github.event.inputs.build_type }}" -eq "RELEASE") { "build\release\dist" } else { "build\dev\dist" }
$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"
- 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"
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: AutoGGUF-${{ matrix.os }}-${{ matrix.arch }}-${{ github.event.inputs.build_type }}-${{ github.sha }}
path: build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist
path: |
build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist
!build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist/AutoGGUF-*.sha256
- name: Upload SHA256
uses: actions/upload-artifact@v2
with:
name: AutoGGUF-${{ github.sha }}-SHA256
path: build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist/AutoGGUF-*.sha256

0 comments on commit bb6f0ef

Please sign in to comment.