From 49d940f57befc581a7028e1c5d91a0a188e336a8 Mon Sep 17 00:00:00 2001 From: Nimrod Teich Date: Tue, 19 Mar 2024 14:36:32 +0200 Subject: [PATCH] Fix version tagging for newer major version --- .github/builder.py | 3 ++- .github/tag_latest.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/builder.py b/.github/builder.py index 513cccd..4612066 100644 --- a/.github/builder.py +++ b/.github/builder.py @@ -19,10 +19,11 @@ def get_release_and_pre_release_tags() -> Tuple[List[str], List[str]]: # only build tags after 0.24 tags = [] for tag in raw_tags: + major = tag.replace("v", "").split(".")[0] minor = tag.replace("v", "").split(".")[1] minor_int = int(minor) - if minor_int >= 24: + if minor_int >= 24 or major > 0: tags.append(tag) releases = [] diff --git a/.github/tag_latest.py b/.github/tag_latest.py index ceba2b7..4490cba 100644 --- a/.github/tag_latest.py +++ b/.github/tag_latest.py @@ -9,8 +9,9 @@ def split_tag(tag): # split with 0 as default value - tag.replace('prerelease-v', 'v') - tag_split = tag.split('.') + ["0", "0", "0"] + tag = tag.replace('prerelease-v', 'v') + tag_split = tag.split('.') + tag_split = tag_split + [tag_split[0], "0", "0"] def safe_str_to_int(s, default=0): try: @@ -19,6 +20,7 @@ def safe_str_to_int(s, default=0): return default tag_split = [safe_str_to_int(x) for x in tag_split] + return (tag_split[0], tag_split[1], tag_split[2], tag_split[3])