Creating Executable of project #31
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: 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 |