From e546800a409e0263ce5e44a854fb86a342456007 Mon Sep 17 00:00:00 2001 From: Alan Ivey Date: Tue, 14 Nov 2023 14:05:06 -0500 Subject: [PATCH] ci: include next version dev if it exists Also, change '17' to 'default_jdk_41up' variable to be more explicit --- .github/workflows/support/matrix/matrix.py | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/support/matrix/matrix.py b/.github/workflows/support/matrix/matrix.py index 2dd5e17..8979d7e 100644 --- a/.github/workflows/support/matrix/matrix.py +++ b/.github/workflows/support/matrix/matrix.py @@ -9,6 +9,9 @@ # Default version of Java to use with builds unless specified default_jdk = 11 +# Default version of Java to use with builds v41 or higher +default_jdk_41up = 17 + # Initialize the full matrix dict full_matrix={ 'dhis2_version': [], @@ -115,20 +118,21 @@ # Add newer Java release to the list of non-default builds full_matrix['include'].append(matrix_item) -# # Include the dev release for the next major version as a Java 17 build -# # NOTE: Uncomment and/or edit logic once v41 builds are available -# dhis2_major_next = f"{Version(dhis2_majors_sorted[-1]).major+1}" -# full_matrix['include'].append({ -# 'dhis2_version': f"{dhis2_major_next}-dev", -# 'java_major': '17', -# 'latest_major': False, -# 'latest_overall': False, -# }) - -# Include a Java 17 build for "dev" +# If dhis.war exists in releases.dhis2.org, include the dev release for the next major version +dhis2_major_next = f"{Version(dhis2_majors_sorted[-1]).major}.{Version(dhis2_majors_sorted[-1]).minor+1}" +dhis2_major_next_war_resp = http.request('HEAD', f'https://releases.dhis2.org/{dhis2_major_next}/dhis.war') +if dhis2_major_next_war_resp.status == 200: + full_matrix['include'].append({ + 'dhis2_version': f"{dhis2_major_next}-dev", + 'java_major': default_jdk_41up, + 'latest_major': False, + 'latest_overall': False, + }) + +# Include a build for "dev" full_matrix['include'].append({ 'dhis2_version': 'dev', - 'java_major': '17', + 'java_major': default_jdk_41up, 'latest_major': False, 'latest_overall': False, })