Skip to content

Build Python Executable #1

Build Python Executable

Build Python Executable #1

Workflow file for this run

# This is the name of the workflow, which will appear in the Actions tab
name: Build Python Executable
# This specifies when the workflow will run.
# It's configured to run when a new 'release' is 'created'.
on:
release:
types: [created]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on.
# We use 'windows-latest' because we want to create a .exe file.
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Step 1: Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Sets up a Python environment for you to use
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # You can change this to your desired Python version
# Step 3: Installs project dependencies from requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 4: Install PyInstaller
- name: Install PyInstaller
run: pip install pyinstaller
# Step 5: Build the executable using PyInstaller
- name: Build with PyInstaller
run: pyinstaller --onefile --windowed PICA_Launcher_V4.py
# Step 6: Upload the executable as an artifact of the release
- name: Upload Executable to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/PICA_Launcher_V4.exe
asset_name: PICA_Launcher_V4-Windows.exe
tag: ${{ github.ref }}
overwrite: true