This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Windows Executable | |
| # Trigger the workflow | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| # Checkout your repository code | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| # Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller pyinstaller-hooks-contrib | |
| # Install your project requirements | |
| if (Test-Path requirements.txt) { pip install -r requirements.txt } | |
| # Build the executable | |
| - name: Build executable with PyInstaller | |
| run: | | |
| pyinstaller --noconfirm --clean --log-level=WARN --onefile --windowed ` | |
| --name PyImageLabeling main.py ` | |
| --exclude-module tkinter ` | |
| --exclude-module PyQt5 ` | |
| --exclude-module PySide6 ` | |
| --exclude-module PySide2 | |
| # Upload the executable as artifact | |
| - name: Upload executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PyImageLabeling-Windows | |
| path: dist/*.exe | |
| retention-days: 30 |