-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the workflow
- Loading branch information
Showing
1 changed file
with
33 additions
and
19 deletions.
There are no files selected for viewing
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
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 }} |