diff --git a/.github/workflows/Build_Executable.yml b/.github/workflows/Build_Executable.yml index 6e2df85..92d7d21 100644 --- a/.github/workflows/Build_Executable.yml +++ b/.github/workflows/Build_Executable.yml @@ -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: + + - name: Install requirements + # 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 }} \ No newline at end of file