Skip to content

Creating Executable of project #37

Creating Executable of project

Creating Executable of project #37

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
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 }}" == "macOS" ]; then
pyinstaller --onefile --name stockAnalysis --add-data "assets:assets" user_interface.py
# Create .dmg file
hdiutil create -volname stockAnalysis -srcfolder dist/ -ov -format UDZO stockAnalysis.dmg
elif [ "${{ runner.os }}" == "Windows" ]; then
pyinstaller --onefile --name stockAnalysis --noconsole --add-data "assets:assets" user_interface.py
else
echo "Unsupported OS: ${{ runner.os }}"
exit 1
fi
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: stockAnalysis-${{ runner.os }}
path: |
dist/stockAnalysis
dist/stockAnalysis