Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
ci: include next version dev if it exists
Browse files Browse the repository at this point in the history
Also, change '17' to 'default_jdk_41up' variable to be more explicit
  • Loading branch information
alanivey committed Nov 14, 2023
1 parent 1427ed8 commit e546800
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/support/matrix/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [],
Expand Down Expand Up @@ -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,
})
Expand Down

0 comments on commit e546800

Please sign in to comment.