Skip to content

Package app to .exe via PyInstaller #3

Package app to .exe via PyInstaller

Package app to .exe via PyInstaller #3

Workflow file for this run

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