From 3f70a01aa2e43a2e2e0e530637a507c1d8570aff Mon Sep 17 00:00:00 2001 From: Jim Hawkins Date: Tue, 16 Apr 2024 10:00:34 +0100 Subject: [PATCH] Add a PowerShell environment variable as a convenience accessor for the version number, and add an explanatory comment about the .ini file piece, and reactivate the ruff check Signed-off-by: Jim Hawkins --- .github/workflows/windows-build-version.yml | 34 ++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-build-version.yml b/.github/workflows/windows-build-version.yml index dca4a58..e86f0d3 100644 --- a/.github/workflows/windows-build-version.yml +++ b/.github/workflows/windows-build-version.yml @@ -7,6 +7,17 @@ on: permissions: contents: write +# In this workflow the release version number is read from a .ini file. That is +# implemented by having one job read the file and print the key-value pair to +# the its output. Another job then uses the output value. +# +# - Output is generated by the `check` job, in the step Get version number. +# - The value is consumed in the `build` job. +# +# And see the reference documentation here. +# https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs + + jobs: check: @@ -31,14 +42,17 @@ jobs: run: | python -m pip install --upgrade pip pip install ruff - # - name: Analysing the code with ruff - # run: | - # ruff check . + - name: Analysing the code with ruff + run: | + ruff check . # The build job runs on a Windows machine and performs various build steps. build: runs-on: windows-latest needs: check + env: + # Convenience variable with a shorter name. + VersionNumber: ${{needs.check.outputs.VersionNumber}} steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -60,22 +74,20 @@ jobs: # pyinstaller --distpath dist-portable build-portable.spec - name: Demo version number run: | - New-Item delme-${{needs.check.outputs.VersionNumber}}.txt -type file - - + New-Item delme-$Env:VersionNumber".txt" -type file # - name: Zip Portable # shell: pwsh # run: | # Copy-Item -Path assets -Destination dist-portable\ -Recurse # Copy-Item -Path configs -Destination dist-portable\ -Recurse - # Compress-Archive -Path dist-portable -DestinationPath FaceCommander-Portable-${{github.ref_name}}.zip - + # Compress-Archive -Path dist-portable -DestinationPath \ + # FaceCommander-Portable-$Env:VersionNumber".zip" # - name: release # uses: softprops/action-gh-release@v1 # with: # files: | - # Output/FaceCommander-Installer-${{github.ref_name}}.exe - # FaceCommander-Portable-${{github.ref_name}}.zip - # tag_name: ${{github.ref_name}} + # Output/FaceCommander-Installer-${{needs.check.outputs.VersionNumber}}.exe + # FaceCommander-Portable-${{needs.check.outputs.VersionNumber}}.zip + # tag_name: ${{needs.check.outputs.VersionNumber}} # draft: false # prerelease: false