51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: Build Windows Executable
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, develop ]
|
|
pull_request:
|
|
branches: [ main, master, develop ]
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 30
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.11']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
pip install python-barcode pillow reportlab
|
|
pip install kivy==2.2.1
|
|
pip install pyinstaller==6.1.0
|
|
|
|
- name: Build executable with PyInstaller
|
|
run: |
|
|
pyinstaller label_printer_gui.py --onefile --windowed --name=LabelPrinter --distpath=./dist --workpath=./build --hidden-import=kivy --hidden-import=PIL --hidden-import=barcode --hidden-import=reportlab --hidden-import=print_label --hidden-import=print_label_pdf -y
|
|
|
|
- name: Upload Windows executable as artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: LabelPrinter-Windows
|
|
path: dist/LabelPrinter.exe
|
|
retention-days: 30
|
|
|
|
- name: Create Release and Upload
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: dist/LabelPrinter.exe
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|