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