Skip to content

Commit

Permalink
Add a test suffix to the version number, and update the workflow to r…
Browse files Browse the repository at this point in the history
…un when it gets modified, and try referring to an environment variable outside any shell

Signed-off-by: Jim Hawkins <sjjhsjjhsjjh@gmail.com>
  • Loading branch information
sjjhsjjh committed Apr 16, 2024
1 parent 2cd7b08 commit 0037d2e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/windows-build-version.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions assets/Version.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
# the Inno Setup Compiler, and in Python.

[Release]
VersionNumber=0.6.2

# Dummy change to force workflow 3.
VersionNumber=0.6.2.test1

0 comments on commit 0037d2e

Please sign in to comment.