CI: use semantic version compare for determing "latest" OpenSSL
authorIlya Shipitsin <chipitsine@gmail.com>
Fri, 29 Dec 2023 22:31:39 +0000 (23:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Jan 2024 18:07:51 +0000 (19:07 +0100)
currently "openssl-3.2.0-beta1" wins over "openssl-3.2.0" due to
string comparision. let's switch to semantic version compare

(cherry picked from commit e6d0b87f7f18cd07163687f15b086eb86ed57957)
Signed-off-by: Willy Tarreau <w@1wt.eu>

.github/matrix.py

index b5a971c..856704d 100755 (executable)
@@ -14,6 +14,7 @@ import re
 import sys
 import urllib.request
 from os import environ
+from packaging import version
 
 #
 # this CI is used for both development and stable branches of HAProxy
@@ -47,7 +48,7 @@ def determine_latest_openssl(ssl):
     latest_tag = ""
     for tag in tags:
         if "openssl-" in tag:
-            if tag > latest_tag:
+            if (not latest_tag) or (version.parse(tag[8:]) > version.parse(latest_tag[8:])):
                 latest_tag = tag
     return "OPENSSL_VERSION={}".format(latest_tag[8:])