Skip to content

Commit 2f70e1c

Browse files
committed
chore(ci): The replacement windows arm JDK is set up to manually install Oracle JDK 21
1 parent 26695a9 commit 2f70e1c

1 file changed

Lines changed: 41 additions & 6 deletions

File tree

.github/workflows/build-desktop.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,47 @@ jobs:
234234
- name: Checkout code
235235
uses: actions/checkout@v4
236236

237-
- name: Set up JDK 21
238-
uses: actions/setup-java@v4
239-
with:
240-
java-version: '21'
241-
distribution: 'oracle'
242-
architecture: 'arm64'
237+
- name: Install Oracle JDK 21
238+
shell: powershell
239+
run: |
240+
$urls = @(
241+
"https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.zip"
242+
)
243+
244+
$zipPath = Join-Path $env:RUNNER_TEMP "oracle-jdk21.zip"
245+
$extractDir = Join-Path $env:RUNNER_TEMP "oracle-jdk21"
246+
247+
if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
248+
New-Item -ItemType Directory -Path $extractDir | Out-Null
249+
250+
$downloaded = $false
251+
foreach ($url in $urls) {
252+
try {
253+
Write-Host "Downloading: $url"
254+
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
255+
$downloaded = $true
256+
break
257+
} catch {
258+
Write-Host "Download failed: $url"
259+
}
260+
}
261+
262+
if (-not $downloaded) {
263+
Write-Error "Could not download Oracle JDK 21 from known URLs"
264+
exit 1
265+
}
266+
267+
Expand-Archive -Path $zipPath -DestinationPath $extractDir -Force
268+
$jdkDir = Get-ChildItem -Path $extractDir -Directory | Select-Object -First 1
269+
if (-not $jdkDir) { Write-Error "Extracted JDK directory not found in $extractDir"; exit 1 }
270+
271+
$javaHome = $jdkDir.FullName
272+
Add-Content $env:GITHUB_ENV "JAVA_HOME=$javaHome"
273+
Add-Content $env:GITHUB_ENV "JAVA_HOME_21_ARM64=$javaHome"
274+
$javaBin = Join-Path $javaHome "bin"
275+
Add-Content $env:GITHUB_PATH $javaBin
276+
277+
java -version
243278
244279
- name: Setup Gradle
245280
uses: gradle/actions/setup-gradle@v3

0 commit comments

Comments
 (0)