Skip to content

Commit 1b27021

Browse files
committed
Manually download Zulu without CRaC via new Azul API - workaround for actions/setup-java#636
1 parent e036096 commit 1b27021

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/release.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
- master
55

66
env:
7-
JAVA_DISTRIBUTION: zulu
87
JAVA_VERSION: 22.0.2+9
98
GRADLE_OPTS: -Dorg.gradle.daemon=false
109

@@ -18,10 +17,18 @@ jobs:
1817
fetch-depth: 0
1918
persist-credentials: false
2019
submodules: true
20+
- name: Download Zulu (without CRaC)
21+
id: download_zulu
22+
shell: bash
23+
run: |
24+
cd $RUNNER_TEMP
25+
jdk_archive_filename=test=$(curl -LOs -w '%{filename_effective}' "$(curl -s -X GET 'https://api.azul.com/metadata/v1/zulu/packages/?os=windows&arch=x64&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&release_status=ga&availability_types=CA&certifications=tck' --data-urlencode "java_version=$JAVA_VERSION" -H 'accept: application/json' | jq -r '.[0].download_url')")
26+
echo "jdk_archive_filename=$jdk_archive_filename" >> $GITHUB_OUTPUT
2127
- name: Install JDK
2228
uses: actions/setup-java@v4
2329
with:
24-
distribution: ${{ env.JAVA_DISTRIBUTION }}
30+
distribution: jdkfile
31+
jdkFile: ${{ runner.temp }}/${{ steps.download_zulu.outputs.jdk_archive_filename }}
2532
java-version: ${{ env.JAVA_VERSION }}
2633
- name: Build
2734
run: ./gradlew distZip --info
@@ -68,10 +75,18 @@ jobs:
6875
fetch-depth: 0
6976
persist-credentials: false
7077
submodules: true
78+
- name: Download Zulu (without CRaC)
79+
id: download_zulu
80+
shell: bash
81+
run: |
82+
cd $RUNNER_TEMP
83+
jdk_archive_filename=test=$(curl -LOs -w '%{filename_effective}' "$(curl -s -X GET 'https://api.azul.com/metadata/v1/zulu/packages/?os=linux&arch=x64&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&release_status=ga&availability_types=CA&certifications=tck' --data-urlencode "java_version=$JAVA_VERSION" -H 'accept: application/json' | jq -r '.[0].download_url')")
84+
echo "jdk_archive_filename=$jdk_archive_filename" >> $GITHUB_OUTPUT
7185
- name: Install JDK
7286
uses: actions/setup-java@v4
7387
with:
74-
distribution: ${{ env.JAVA_DISTRIBUTION }}
88+
distribution: jdkfile
89+
jdkFile: ${{ runner.temp }}/${{ steps.download_zulu.outputs.jdk_archive_filename }}
7590
java-version: ${{ env.JAVA_VERSION }}
7691
- name: Build
7792
run: ./gradlew distTar --info

0 commit comments

Comments
 (0)