Skip to content

Commit

Permalink
Publish workflow: Fix JDK latest version fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenali authored Oct 18, 2024
1 parent 7e2bfac commit 2d97716
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
echo "Fetching latest versions of JDK (${jdk_list}):"
echo "### JDK Versions List:" >> $GITHUB_STEP_SUMMARY
for major_jdk_version in ${jdk_list//,/ }; do
latestversion=$(curl -fsSL -X GET "https://api.azul.com/metadata/v1/zulu/packages/?java_version=${major_jdk_version}&os=ubuntu&arch=amd&java_package_type=jdk&javafx_bundled=true&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=1" -H "accept: application/json" | jq -r '.[].java_version | join(",")')
latestversion=$(curl -fsSL -X GET "https://api.azul.com/metadata/v1/zulu/packages/?java_version=${major_jdk_version}&os=ubuntu&arch=amd&java_package_type=jdk&javafx_bundled=false&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=1" -H "accept: application/json" | jq -r '.[].java_version | join(",")')
[ ${major_jdk_version} -lt '10' ] && paddingspace=" " || paddingspace=
echo " - JDK ${paddingspace}${major_jdk_version}: $(echo ${latestversion} | sed 's/,/./g')"
echo " - JDK ${paddingspace}${major_jdk_version}: $(echo ${latestversion} | sed 's/,/./g')" >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:
fi
echo "Fetching latest versions of JDK (${jdk_list}):"
for major_jdk_version in ${jdk_list//,/ }; do
latestversion=$(curl -fsSL -X GET "https://api.azul.com/metadata/v1/zulu/packages/?java_version=${major_jdk_version}&os=ubuntu&arch=amd&java_package_type=jdk&javafx_bundled=true&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=1" -H "accept: application/json" | jq -r '.[].java_version | join(",")')
latestversion=$(curl -fsSL -X GET "https://api.azul.com/metadata/v1/zulu/packages/?java_version=${major_jdk_version}&os=ubuntu&arch=amd&java_package_type=jdk&javafx_bundled=false&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=1" -H "accept: application/json" | jq -r '.[].java_version | join(",")')
if [ -z "${latestversion}" ]; then
echo "Error: Cannot find latest version for JDK ${major_jdk_version}! Abort!"
exit 1
Expand All @@ -284,4 +284,4 @@ jobs:
git diff-index --quiet HEAD || git commit -m "Automated JDK versions README update"
git push origin HEAD
env:
jdk_list: 8,11,17,21
jdk_list: 8,11,17,21

0 comments on commit 2d97716

Please sign in to comment.