From 0037d2ef0a9ae216fb30b4dcb65bb81268a71090 Mon Sep 17 00:00:00 2001 From: Jim Hawkins Date: Tue, 16 Apr 2024 14:21:59 +0100 Subject: [PATCH] Add a test suffix to the version number, and update the workflow to run when it gets modified, and try referring to an environment variable outside any shell Signed-off-by: Jim Hawkins --- .github/workflows/windows-build-version.yml | 48 ++++++++++++++------- assets/Version.ini | 4 +- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.github/workflows/windows-build-version.yml b/.github/workflows/windows-build-version.yml index 3485ef5..4910d57 100644 --- a/.github/workflows/windows-build-version.yml +++ b/.github/workflows/windows-build-version.yml @@ -1,8 +1,13 @@ on: + # Make it appear in the GitHub web user interface, if this workflow is in the + # default branch, main. workflow_dispatch: push: + # Trigger workflow if the version number is changed or if the workflow + # itself is changed. paths: - 'assets/Version.ini' + - '.github/workflows/windows-build-version.yml' permissions: contents: write @@ -17,7 +22,6 @@ permissions: # And see the reference documentation here. # https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs - jobs: check: @@ -51,33 +55,44 @@ jobs: runs-on: windows-latest needs: check env: - # Convenience variable with a shorter name. + # Convenience variables with shorter names. Environment variables cannot + # be specified in terms of other environment variables. VersionNumber: ${{needs.check.outputs.VersionNumber}} + VersionTag: v${{needs.check.outputs.VersionNumber}} steps: - name: Create tag + # TOTH Create a tag with GitHub Script + # https://stackoverflow.com/a/64479344/7657675 + # Use environment variables https://stackoverflow.com/a/63485275/7657675 + + + + # + # This step fails if the tag exists already, which is intentional. id: create_tag uses: actions/github-script@v7 with: - # https://stackoverflow.com/a/64479344/7657675 script: | github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, - ref: "refs/tags/v${{needs.check.outputs.VersionNumber}}", + ref: "refs/tags/${{env.VersionTag}}", sha: context.sha }) - - name: Demo version number - run: | - New-Item delme-env-$Env:VersionNumber".txt" -type file - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies + - name: Demo version number and PowerShell line continuation run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + New-Item ` + delme-env-$Env:VersionNumber".txt" ` + -type file + # - uses: actions/checkout@v3 + # - name: Set up Python 3.10 + # uses: actions/setup-python@v3 + # with: + # python-version: "3.10" + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install -r requirements.txt # - name: Freeze Installer # run: | # pyinstaller build.spec @@ -99,7 +114,8 @@ jobs: # uses: softprops/action-gh-release@v1 # with: # files: | - # Output/FaceCommander-Installer-v${{needs.check.outputs.VersionNumber}}.exe + # Output/FaceCommander-Installer- + # v${{needs.check.outputs.VersionNumber}}.exe # FaceCommander-Portable-v${{needs.check.outputs.VersionNumber}}.zip # name: v${{needs.check.outputs.VersionNumber}} # draft: true diff --git a/assets/Version.ini b/assets/Version.ini index 0f2d30d..527194e 100644 --- a/assets/Version.ini +++ b/assets/Version.ini @@ -9,6 +9,4 @@ # the Inno Setup Compiler, and in Python. [Release] -VersionNumber=0.6.2 - -# Dummy change to force workflow 3. \ No newline at end of file +VersionNumber=0.6.2.test1