Skip to content

Generate Python Executable for Windows #26

Generate Python Executable for Windows

Generate Python Executable for Windows #26

name: Generate Python Executable for Windows
on:
workflow_dispatch: # manually triggered
inputs:
tag:
required: true
type: string
description: the semver tag your release will have
jobs:
create-executable-and-release:
runs-on: windows-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.8.10"
- name: Install requirements
run: pip install -r requirements.txt
- name: Install Pyinstaller
run: pip install -U pyinstaller
- name: Compile executable
run: |
$env:PYTHONPATH = "$env:GITHUB_WORKSPACE;$env:PYTHONPATH"
pyinstaller --onefile --name sierra-status --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: |
Get-Location
Get-ChildItem
- name: Release
uses: softprops/action-gh-release@v2
with:
files: dist/sierra-status.exe
tag_name: ${{ inputs.tag }}
- name: Print directory structure
run: |
Get-ChildItem -Recurse