mirror of https://github.com/leafspark/AutoGGUF
ci: add sha256 generation support to build.yml
This commit is contained in:
parent
a97a545a28
commit
bb6f0efa63
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue