Skip to content

Commit 048bece

Browse files
authored
ci: add build workflow
1 parent ea4f0a0 commit 048bece

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/build.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build PyInstaller App
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build_type:
7+
description: 'Build type (RELEASE or DEV)'
8+
required: true
9+
default: 'RELEASE'
10+
type: choice
11+
options:
12+
- RELEASE
13+
- DEV
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [windows-latest, ubuntu-latest, macos-latest]
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: '3.x'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install -r requirements.txt
34+
pip install pyinstaller
35+
36+
- name: Build with PyInstaller (Windows)
37+
if: matrix.os == 'windows-latest'
38+
run: |
39+
if ("${{ github.event.inputs.build_type }}" -eq "RELEASE") {
40+
pyinstaller --windowed --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets;assets" --distpath=build\release\dist --workpath=build\release\build --specpath=build\release src\main.py
41+
} else {
42+
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
43+
}
44+
45+
- name: Build with PyInstaller (Linux/macOS)
46+
if: matrix.os != 'windows-latest'
47+
run: |
48+
if [ "${{ github.event.inputs.build_type }}" = "RELEASE" ]; then
49+
pyinstaller --windowed --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets:assets" --distpath=build/release/dist --workpath=build/release/build --specpath=build/release src/main.py
50+
else
51+
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
52+
fi
53+
54+
- name: Upload Artifact
55+
uses: actions/upload-artifact@v2
56+
with:
57+
name: AutoGGUF-${{ matrix.os }}-${{ github.event.inputs.build_type }}-${{ github.sha::7 }}
58+
path: build/${{ github.event.inputs.build_type == 'RELEASE' && 'release' || 'dev' }}/dist/AutoGGUF*

0 commit comments

Comments
 (0)