Skip to content

Commit

Permalink
update to update automatically the release
Browse files Browse the repository at this point in the history
  • Loading branch information
elkanamol committed Sep 1, 2024
1 parent a3ab066 commit 0b86439
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/Build_Executable.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: Generate Python Executable for Windows

on:
workflow_dispatch: # manually triggered
workflow_dispatch:
inputs:
tag:
required: true
required: false
type: string
description: the semver tag your release will have
description: Override the version tag (leave empty to use version from __version__.py)

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

jobs:
create-executable-and-release:
Expand Down Expand Up @@ -37,12 +45,26 @@ jobs:
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: Get version
id: get_version
run: |
$version = (Get-Content .\sierra_status\__version__.py | Select-String -Pattern "__version__\s*=\s*['\"](.*)['\"]").Matches.Groups[1].Value
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# files: dist/sierra-status.exe
# tag_name: v${{ steps.get_version.outputs.VERSION }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: dist/sierra-status.exe
tag_name: ${{ inputs.tag }}
tag_name: ${{ inputs.tag || format('v{0}', steps.get_version.outputs.VERSION) }}


- name: Print directory structure
run: |
Get-ChildItem -Recurse

0 comments on commit 0b86439

Please sign in to comment.