mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-18 07:46:45 +00:00
Fix Java_Adopt_Jdk permissions (#3605)
This commit is contained in:
committed by
GitHub
parent
82fa8f2880
commit
0b6b04be64
@@ -60,16 +60,13 @@ function Install-JavaFromAdoptOpenJDK {
|
|||||||
-and $_.binary.architecture -eq $Architecture `
|
-and $_.binary.architecture -eq $Architecture `
|
||||||
-and $_.binary.image_type -eq "jdk"
|
-and $_.binary.image_type -eq "jdk"
|
||||||
}
|
}
|
||||||
$downloadUrl = $asset.binary.package.link
|
|
||||||
# We have to replace '+' sign in the version to '-' due to the issue with incorrect path in Android builds https://github.com/actions/virtual-environments/issues/3014
|
|
||||||
$fullJavaVersion = $asset.version.semver -replace '\+', '-'
|
|
||||||
|
|
||||||
# Download and extract java binaries to temporary folder
|
# Download and extract java binaries to temporary folder
|
||||||
|
$downloadUrl = $asset.binary.package.link
|
||||||
$archivePath = Start-DownloadWithRetry -Url $downloadUrl -Name $([IO.Path]::GetFileName($downloadUrl))
|
$archivePath = Start-DownloadWithRetry -Url $downloadUrl -Name $([IO.Path]::GetFileName($downloadUrl))
|
||||||
$javaTempPath = Join-Path -Path $env:TEMP -ChildPath "Java_$fullJavaVersion"
|
|
||||||
Extract-7Zip -Path $archivePath -DestinationPath $javaTempPath
|
|
||||||
$javaTempBinariesPath = Join-Path -Path $javaTempPath -ChildPath "\jdk*\"
|
|
||||||
|
|
||||||
|
# We have to replace '+' sign in the version to '-' due to the issue with incorrect path in Android builds https://github.com/actions/virtual-environments/issues/3014
|
||||||
|
$fullJavaVersion = $asset.version.semver -replace '\+', '-'
|
||||||
# Create directories in toolcache path
|
# Create directories in toolcache path
|
||||||
$javaToolcachePath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Java_Adopt_jdk"
|
$javaToolcachePath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Java_Adopt_jdk"
|
||||||
$javaVersionPath = Join-Path -Path $javaToolcachePath -ChildPath $fullJavaVersion
|
$javaVersionPath = Join-Path -Path $javaToolcachePath -ChildPath $fullJavaVersion
|
||||||
@@ -84,8 +81,9 @@ function Install-JavaFromAdoptOpenJDK {
|
|||||||
Write-Host "Creating Java '${fullJavaVersion}' folder in '${javaVersionPath}'"
|
Write-Host "Creating Java '${fullJavaVersion}' folder in '${javaVersionPath}'"
|
||||||
New-Item -ItemType Directory -Path $javaVersionPath -Force | Out-Null
|
New-Item -ItemType Directory -Path $javaVersionPath -Force | Out-Null
|
||||||
|
|
||||||
# Complete the installation by moving Java binaries from temporary directory to toolcache and creating the complete file
|
# Complete the installation by extarcting Java binaries to toolcache and creating the complete file
|
||||||
Move-Item -Path $javaTempBinariesPath -Destination $javaArchPath
|
Extract-7Zip -Path $archivePath -DestinationPath $javaVersionPath
|
||||||
|
Get-ChildItem -Path $javaVersionPath | Rename-Item -NewName $javaArchPath
|
||||||
New-Item -ItemType File -Path $javaVersionPath -Name "$Architecture.complete" | Out-Null
|
New-Item -ItemType File -Path $javaVersionPath -Name "$Architecture.complete" | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user