Skip to content

Creating Executable of project #12

Creating Executable of project

Creating Executable of project #12

Workflow file for this run

name: Create executables
on:
pull_request:
branches:
- main
types: [labeled]
jobs:
build:
if: contains(github.event.issue.labels.*.name, 'create-builds')
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-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 (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 (macOS)
if: matrix.os == 'macos-latest'
run: |
pyinstaller --onefile --noconsole --add-data "assets:assets" user_interface.py
hdiutil create -volname UserInterface -srcfolder dist/ -ov -format UDZO user_interface.dmg
shell: bash
- name: Create executable (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
pyinstaller --onefile --noconsole --add-data "assets:assets" user_interface.py
shell: bash
- name: Create executable (Windows)
if: matrix.os == 'windows-latest'
run: |
pyinstaller --onefile --noconsole --add-data "assets;assets" user_interface.py
shell: pwsh
- name: Upload executable (macOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: user_interface-macOS
path: user_interface.dmg
- name: Upload executable (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: user_interface-Linux
path: dist/user_interface
- name: Upload executable (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: user_interface-Windows
path: dist/user_interface.exe