From 151a06c17548d9633f9ca2de412c523ba3b4b344 Mon Sep 17 00:00:00 2001 From: Paul Adkisson Date: Thu, 7 Nov 2024 06:22:31 +1100 Subject: [PATCH] Update update-version.yml to support multi-digit versions --- .github/workflows/update-version.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 7c456c57..c5b9ab58 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -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"