Skip to content

Commit

Permalink
Update update-version.yml to support multi-digit versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson authored Nov 6, 2024
1 parent 92a5c09 commit 151a06c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
- name: Update dev version
run: |
git fetch --prune --unshallow --tags
tags="$(git tag --sort version:refname)"
latest_tag=${tags: -6 : 6}
old_version=${latest_tag:1:5}
tags=("${(@f)$(git tag --list --sort version:refname)}")
latest_tag=${tags[-1]}
old_version="${latest_tag:1}"
echo "Old Version: $old_version"
old_major_version=${old_version:0:1}
old_minor_version=${old_version:2:1}
old_patch_version=${old_version:4:1}
split_old_version=("${(@s:.:)old_version}")
old_major_version=${split_old_version[0]}
old_minor_version=${split_old_version[1]}
old_patch_version=${split_old_version[2]}
new_patch_version=`expr $old_patch_version + 1`
new_version="$old_major_version.$old_minor_version.$new_patch_version"
echo "New Version: $new_version"
Expand Down

0 comments on commit 151a06c

Please sign in to comment.