From 0b86439cb8f26fd7efbe048f08d513af62a934f0 Mon Sep 17 00:00:00 2001 From: Elkana Molson Date: Sun, 1 Sep 2024 14:12:50 +0300 Subject: [PATCH] update to update automatically the release --- .github/workflows/Build_Executable.yml | 30 ++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build_Executable.yml b/.github/workflows/Build_Executable.yml index 3926cf5..6085f0c 100644 --- a/.github/workflows/Build_Executable.yml +++ b/.github/workflows/Build_Executable.yml @@ -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: @@ -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 +