--hidden-import=PyQt6 #3
This file contains 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: Release EXE | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
runs-on: windows-latest | |
steps: | |
# 1. Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 2. Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
# 3. Install dependencies using Poetry | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
# 4. Install PyInstaller | |
- name: Install PyInstaller | |
run: | | |
pip install pyinstaller | |
# 5. Build the executable with PyInstaller | |
- name: Build executable with PyInstaller | |
run: | | |
poetry run pyinstaller src/gui/main.py --onefile --name pid-sim.exe --collect-all PyQt6 --hidden-import=PyQt6 --clean --debug=all | |
# 6. Verify the build (optional) | |
- name: Verify executable | |
run: | | |
if (!(Test-Path "dist\pid-sim.exe")) { | |
Write-Error "Executable not found!" | |
exit 1 | |
} | |
# 7. Display directory structure for debugging (optional) | |
- name: Display directory structure | |
run: | | |
dir dist | |
shell: cmd | |
# 8. Create Release and Upload EXE | |
- name: Create Release and Upload EXE | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: "Release ${{ github.run_number }}" | |
tag_name: "release-${{ github.run_number }}" | |
files: "dist/pid-sim.exe" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |