Package app to .exe via PyInstaller #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: Package app to .exe via PyInstaller | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install pyinstaller pillow pyqt6 | |
- name: Convert .png icon to .ico | |
run: | | |
python -c "from PIL import Image; img = Image.open('math_trainer/math-trainer-icon.png'); img.save('MathTrainer/math_trainer/math-trainer-icon.ico', format='ICO', sizes=[(256, 256)])" | |
- name: Package via PyInstaller | |
run: | | |
pyinstaller --onefile --windowed --icon=MathTrainer/math_trainer/math-trainer-icon.ico --name=math-trainer --add-data .:. MathTrainer/math_trainer/main.py | |
working-directory: math_trainer | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: math-trainer | |
path: MathTrainer/math_trainer/dist/math-trainer.exe |