From 9552ad3b76e0140f5cdc07b0c80c0061001d7b8d Mon Sep 17 00:00:00 2001 From: Anton Antonov Date: Wed, 13 Aug 2025 02:55:39 +0300 Subject: [PATCH] fix(ci): update app version script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get the latest draft version from the GitHub Releases and take into accoutn that the most recent version is the latest version, while the second most recent version is the second entry. ❯ gh release list -L 5 TITLE TYPE TAG NAME PUBLISHED 2.2.27 Latest 2.2.27 about 5 days ago 2.2.28 Draft 2.2.28 about 1 month ago 2.2.26 2.2.26 about 1 month ago 2.2.25 2.2.25 about 2 months ago 2.2.24 2.2.24 about 2 months ago --- scripts/update_app_version.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/update_app_version.sh b/scripts/update_app_version.sh index e4655b64..3365944f 100755 --- a/scripts/update_app_version.sh +++ b/scripts/update_app_version.sh @@ -9,7 +9,17 @@ APP_VERSION_FILE="APP_VERSION" # This script is used to update the version of the app. -LATEST_DRAFT_VERSION=$(gh release list -L 1 | awk -F '\t' '{if (match($3, "^[0-9]+\\.[0-9]+\\.[0-9]+")) print $3}') +# Get the latest draft version from the GitHub Releases +# and take into accoutn that the most recent version is the latest version, +# while the second most recent version is the second entry. +# ❯ gh release list -L 5 +# TITLE TYPE TAG NAME PUBLISHED +# 2.2.27 Latest 2.2.27 about 5 days ago +# 2.2.28 Draft 2.2.28 about 1 month ago +# 2.2.26 2.2.26 about 1 month ago +# 2.2.25 2.2.25 about 2 months ago +# 2.2.24 2.2.24 about 2 months ago +LATEST_DRAFT_VERSION=$(gh release list -L 20 | awk -F '\t' '{if ($2 == "Draft" && match($3, "^[0-9]+\\.[0-9]+\\.[0-9]+")) {print $3; exit}}') LATEST_VERSION=$(gh release view --json tagName -q .tagName) if [[ $LATEST_DRAFT_VERSION == $LATEST_VERSION ]]; then