From d7eda18a8f9141d62d7e79f8fcd61de92f9c98b4 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Mon, 12 Jan 2026 12:56:46 +0100 Subject: [PATCH] feat: add support for IBM Semeru Runtime Certified Edition for Java 25 --- bin/semeru16.bash | 2 +- bin/semeru18.bash | 2 +- bin/semeru19.bash | 2 +- bin/semeru20.bash | 2 +- bin/semeru22.bash | 2 +- bin/semeru23.bash | 2 +- bin/semeru24.bash | 2 +- bin/semeru25-certified.bash | 116 ++++++++++++++++++++++++++++++++++++ bin/semeru25.bash | 2 +- bin/semeru8.bash | 2 +- 10 files changed, 125 insertions(+), 9 deletions(-) create mode 100755 bin/semeru25-certified.bash diff --git a/bin/semeru16.bash b/bin/semeru16.bash index 202fcbdadf..bb4ae9ad6d 100755 --- a/bin/semeru16.bash +++ b/bin/semeru16.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru18.bash b/bin/semeru18.bash index e208abb890..cfdc03f741 100755 --- a/bin/semeru18.bash +++ b/bin/semeru18.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru19.bash b/bin/semeru19.bash index ff927630d9..1d2e57ac7f 100755 --- a/bin/semeru19.bash +++ b/bin/semeru19.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru20.bash b/bin/semeru20.bash index 4484ceedf8..7e972ba4fd 100755 --- a/bin/semeru20.bash +++ b/bin/semeru20.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru22.bash b/bin/semeru22.bash index ac976b8f2e..d2765a1a1a 100755 --- a/bin/semeru22.bash +++ b/bin/semeru22.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru23.bash b/bin/semeru23.bash index 795a354587..30b9c4788f 100755 --- a/bin/semeru23.bash +++ b/bin/semeru23.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru24.bash b/bin/semeru24.bash index c0866bab63..2ac1a0d6d8 100755 --- a/bin/semeru24.bash +++ b/bin/semeru24.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru25-certified.bash b/bin/semeru25-certified.bash new file mode 100755 index 0000000000..2ab4524b6d --- /dev/null +++ b/bin/semeru25-certified.bash @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +set -e +set -Euo pipefail + +TEMP_DIR=$(mktemp -d) +trap 'rm -rf ${TEMP_DIR}' EXIT + +if [[ "$#" -lt 2 ]] +then + echo "Usage: ${0} metadata-directory checksum-directory" + exit 1 +fi + +# shellcheck source=bin/functions.bash +source "$(dirname "${0}")/functions.bash" + +VENDOR='semeru' +METADATA_DIR="${1}/${VENDOR}" +CHECKSUM_DIR="${2}/${VENDOR}" + +ensure_directory "${METADATA_DIR}" +ensure_directory "${CHECKSUM_DIR}" + +function normalize_release_type { + case "${1}" in + *) echo 'ga' + ;; + esac +} + +function download { + local tag_name="${1}" + local asset_name="${2}" + local filename="${asset_name}" + + local url="https://github.com/ibmruntimes/semeru25-certified-binaries/releases/download/${tag_name}/${asset_name}" + local metadata_file="${METADATA_DIR}/${filename}.json" + local archive="${TEMP_DIR}/${filename}" + + if [[ -f "${metadata_file}" ]] + then + echo "Skipping ${filename}" + else + download_file "${url}" "${archive}" || return 1 + + local JAVA_VERSION="" + local OPENJ9_VERSION="" + #local RPM_VERSION="" + local RELEASE_TYPE="ga" + local IMAGE_TYPE="" + local OS="" + local ARCH="" + local EXT="" + local regex + + # shellcheck disable=SC2016 + version_regex='s/^jdk-(.*)_openj9-(.*)$/JAVA_VERSION="$1" OPENJ9_VERSION="$2"/g' + eval "$(perl -pe "${version_regex}" <<< "${tag_name}")" + local VERSION="${JAVA_VERSION}_openj9-${OPENJ9_VERSION}" + + if [[ "${filename}" =~ \.rpm$ ]] + then + OS='linux' + EXT='rpm' + + # shellcheck disable=SC2016 + regex='s/^ibm-semeru-certified-[0-9]+-(jre|jdk)-(.+)\.(x86_64|s390x|ppc64|ppc64le|aarch64)\.rpm$/IMAGE_TYPE="$1" RPM_VERSION="$2" ARCH="$3"/g' + else + # shellcheck disable=SC2016 + regex='s/^ibm-semeru-certified-(jre|jdk)_(x64|x86-32|x86-64|x86_64|s390x|ppc64|ppc64le|aarch64)_(aix|linux|mac|windows)_.+\.(tar\.gz|zip|msi)$/IMAGE_TYPE="$1" ARCH="$2" OS="$3" EXT="$4"/g' + fi + + # Parse meta-data from file name + eval "$(perl -pe "${regex}" <<< "${asset_name}")" + + local json + json="$(metadata_json \ + "${VENDOR}" \ + "${filename}" \ + "$(normalize_release_type "${RELEASE_TYPE}")" \ + "${VERSION}" \ + "${JAVA_VERSION}" \ + 'openj9' \ + "$(normalize_os "${OS}")" \ + "$(normalize_arch "${ARCH}")" \ + "${EXT}" \ + "${IMAGE_TYPE}" \ + 'certified' \ + "${url}" \ + "$(hash_file 'md5' "${archive}" "${CHECKSUM_DIR}")" \ + "$(hash_file 'sha1' "${archive}" "${CHECKSUM_DIR}")" \ + "$(hash_file 'sha256' "${archive}" "${CHECKSUM_DIR}")" \ + "$(hash_file 'sha512' "${archive}" "${CHECKSUM_DIR}")" \ + "$(file_size "${archive}")" \ + "${filename}" + )" + + echo "${json}" > "${metadata_file}" + rm -f "${archive}" + fi +} + +RELEASE_FILE="${TEMP_DIR}/releases-${VENDOR}-25.json" +download_github_releases 'ibmruntimes' 'semeru25-certified-binaries' "${RELEASE_FILE}" + +versions=$(jq -r '.[].tag_name' "${RELEASE_FILE}" | sort -V) +for version in ${versions} +do + assets=$(jq -r ".[] | select(.prerelease == false) | select(.tag_name == \"${version}\") | .assets[] | select(.name | endswith(\"zip\") or endswith(\"tar.gz\") or endswith(\"msi\") or endswith(\"rpm\")) | select(.name | contains(\"debugimage\") | not) | select(.name | contains(\"testimage\") | not) | .name" "${RELEASE_FILE}") + for asset in ${assets} + do + download "${version}" "${asset}" || echo "Cannot download ${asset}" + done +done + +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru25.bash b/bin/semeru25.bash index efedc37cba..8a1c4419c5 100755 --- a/bin/semeru25.bash +++ b/bin/semeru25.bash @@ -113,4 +113,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json" diff --git a/bin/semeru8.bash b/bin/semeru8.bash index 11cd487880..be78ae4620 100755 --- a/bin/semeru8.bash +++ b/bin/semeru8.bash @@ -115,4 +115,4 @@ do done done -jq -s -S . "${METADATA_DIR}"/ibm-semeru-open-*.json > "${METADATA_DIR}/all.json" +jq -s -S . "${METADATA_DIR}"/ibm-semeru-*.json > "${METADATA_DIR}/all.json"