Skip to content

Creating Executable of project #31

Creating Executable of project

Creating Executable of project #31

Workflow file for this run

name: Deploy app and create executables
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pip install yahooquery
pip install yahooquery tkmacosx
- name: Create executable
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
pyinstaller --onefile --add-data "assets:assets" user_interface.py
# Download AppImage tool
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage dist/ user_interface.AppImage
elif [ "${{ runner.os }}" == "macOS" ]; then
pyinstaller --onefile --noconsole --add-data "assets:assets" user_interface.py
# Create .dmg file
hdiutil create -volname UserInterface -srcfolder dist/ -ov -format UDZO user_interface.dmg
else
echo "Unsupported OS: ${{ runner.os }}"
exit 1
fi
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: user_interface-${{ runner.os }}
path: |
dist/user_interface.AppImage
dist/user_interface.dmg