Skip to content

Commit

Permalink
gha: handle manual tag case. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
baracudda committed Feb 14, 2024
1 parent 1a28b31 commit 61ad73a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ jobs:
- name: "Determine Version"
id: config_step
run: |-
VER_BUILD=$(date +%H%M)
# limit to only first 3 chars
VER_BUILD=${VER_BUILD:0:3}
# 'strict' semver segments cannot start with 0
VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}"
# recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int.
VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}"
VERSION_STR=${VERSION_NUM}
if [[ ${{ github.ref_name }} =~ ^(v)([[:digit:]]+\..*)$ ]]; then
VERSION_STR=${BASH_REMATCH[2]}
else
VER_BUILD=$(date +%H%M)
# limit to only first 3 chars
VER_BUILD=${VER_BUILD:0:3}
# 'strict' semver segments cannot start with 0
VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}"
# recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int.
VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}"
VERSION_STR=${VERSION_NUM}
fi
echo "VERSION_STR=${VERSION_STR}" >> $GITHUB_OUTPUT
echo "::notice::Version STR=${VERSION_STR}"
#endjob build_cfg
Expand Down

0 comments on commit 61ad73a

Please sign in to comment.