Generate Python Executable for Linux #3
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: Generate Python Executable for Linux | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
required: true | |
type: string | |
description: The semver tag for your Linux release | |
jobs: | |
create-linux-executable-and-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: . | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: Install Pyinstaller | |
run: pip install -U pyinstaller | |
- name: Compile executable | |
run: | | |
export PYTHONPATH="$GITHUB_WORKSPACE:$PYTHONPATH" | |
pyinstaller --onefile --name sierra-status-linux --hidden-import=sierra_status.__version__ --hidden-import=serial --hidden-import=argparse --add-data "sierra_status:sierra_status" ./sierra_status/src/cli.py | |
- name: Check working directory | |
run: | | |
pwd | |
ls -R | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/sierra-status-linux | |
tag_name: ${{ inputs.tag }}-linux | |
- name: Print directory structure | |
run: | | |
find . |