Skip to content

Commit

Permalink
Update Build_Executable.yml
Browse files Browse the repository at this point in the history
update the workflow
  • Loading branch information
elkanamol committed Sep 1, 2024
1 parent f14c399 commit 95010d2
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions .github/workflows/Build_Executable.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
name: Build Executable
name: Generate Python Executable for Windows

on:
release:
types: [created]
workflow_dispatch: # manually triggered
inputs:
tag:
required: true
type: string
description: the semver tag your release will have

jobs:
build:
create-executable-and-release:
runs-on: windows-latest
permissions:
contents: write #allows the job to create a release

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install .
- name: Build executable
run: pyinstaller --onefile --name sierra-status sierra_status/src/cli.py
- name: Upload artifact
uses: actions/upload-artifact@v2
python-version: <your version here>

- name: Install requirements
# working-directory: <your working directory> # can remove this field if your working directory is root
run: pip install -r requirements.txt

- name: Install Pyinstaller
run: pip install -U pyinstaller

- name: Compile executable
# working-directory: # again, app directory here or skip if root
run: pyinstaller --onefile --name sierra-status --hidden-import=serial --hidden-import=argparse .\sierra_status\src\cli.py #or whatever your main file is named

- name: Release
uses: softprops/action-gh-release
with:
name: sierra-status
path: dist/sierra-status.exe
files: dist/sierra-status.exe
tag_name: ${{ inputs.tag }}

0 comments on commit 95010d2

Please sign in to comment.