Files
label_printer/.github/workflows/build-windows.yml
2026-02-05 10:07:21 +02:00

58 lines
1.3 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
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
pip install -r requirements_windows.txt
- name: Verify build setup
run: |
echo "Python version:"
python --version
echo "Installed packages:"
pip list
echo "Current directory:"
cd %CD%
echo "Files in directory:"
dir /B
- name: Build executable with PyInstaller
run: python build_exe.py
- 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 }}