Skip to content

Creating Executable of project #51

Creating Executable of project

Creating Executable of project #51

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:
- macos-latest
- windows-latest
- ubuntu-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 (Bash)
if: runner.os != 'Windows'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pip install yahooquery
pip install tkmacosx
shell: bash
- name: Install dependencies (PowerShell)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pip install yahooquery
pip install tkmacosx
shell: pwsh
- name: Create executable (Bash)
if: runner.os != 'Windows'
run: |
if [ "${{ runner.os }}" == "macOS" ]; then
pyinstaller --onefile --noconsole --add-data "assets:assets" user_interface.py
hdiutil create -volname UserInterface -srcfolder dist/ -ov -format UDZO user_interface.dmg
elif [ "${{ runner.os }}" == "Linux" ]; then
pyinstaller --onefile --noconsole --add-data "assets:assets" user_interface.py
else
echo "Unsupported OS: ${{ runner.os }}"
exit 1
shell: bash
- name: Create executable (PowerShell)
if: runner.os == 'Windows'
run: |
pyinstaller --onefile --noconsole --add-data "assets;assets" user_interface.py
shell: pwsh
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: user_interface-${{ runner.os }}
path: |
user_interface.dmg
dist/user_interface.app
dist/
dist/user_interface.zip
dist/user_interface.exe