diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4bf36e0..4e035ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build PyInstaller App +name: Build AutoGGUF (PyInstaller) on: workflow_dispatch: @@ -31,7 +31,7 @@ jobs: run: | python -m pip install --upgrade pip pip install $(grep -v "^torch" requirements.txt) - pip install pyinstaller + pip install pyinstaller pillow - name: Build with PyInstaller (Windows) if: matrix.os == 'windows-latest' @@ -51,8 +51,27 @@ jobs: pyinstaller --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets:assets" --distpath=build/dev/dist --workpath=build/dev/build --specpath=build/dev src/main.py fi + - name: Copy additional files (Windows) + if: matrix.os == 'windows-latest' + run: | + $distPath = if ("${{ github.event.inputs.build_type }}" -eq "RELEASE") { "build\release\dist" } else { "build\dev\dist" } + New-Item -ItemType Directory -Force -Path "$distPath\src\gguf-py" + Copy-Item -Path "src\gguf-py\*" -Destination "$distPath\src\gguf-py" -Recurse + Copy-Item -Path "src\convert_lora_to_gguf.py" -Destination "$distPath\src" + Copy-Item -Path "src\convert_lora_to_ggml.py" -Destination "$distPath\src" + + - name: Copy additional files (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) + mkdir -p $distPath/src/gguf-py + cp -R src/gguf-py/* $distPath/src/gguf-py/ + cp src/convert_lora_to_gguf.py $distPath/src/ + cp src/convert_lora_to_ggml.py $distPath/src/ + - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: AutoGGUF-${{ matrix.os }}-${{ github.event.inputs.build_type }}-${{ github.sha }} - path: build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist/AutoGGUF* + path: build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist +