mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Ubuntu] Convert non valid java semver (#5131)
* Convert non valid java semver * remove whitespace * Update regex
This commit is contained in:
committed by
GitHub
parent
5b141f6a20
commit
b7e6ffd8d3
@@ -76,6 +76,10 @@ installOpenJDK() {
|
|||||||
# If there is no semver in java release, then extract java version from -fullversion
|
# If there is no semver in java release, then extract java version from -fullversion
|
||||||
[[ -z ${fullJavaVersion} ]] && fullJavaVersion=$(${javaVersionPath}/bin/java -fullversion 2>&1 | tr -d "\"" | tr "+" "-" | awk '{print $4}')
|
[[ -z ${fullJavaVersion} ]] && fullJavaVersion=$(${javaVersionPath}/bin/java -fullversion 2>&1 | tr -d "\"" | tr "+" "-" | awk '{print $4}')
|
||||||
|
|
||||||
|
# Convert non valid semver like 11.0.14.1-9 -> 11.0.14-9
|
||||||
|
# https://github.com/adoptium/temurin-build/issues/2248
|
||||||
|
[[ ${fullJavaVersion} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]] && fullJavaVersion=$(echo $fullJavaVersion | sed -E 's/\.[0-9]+-/-/')
|
||||||
|
|
||||||
javaToolcacheVersionPath="${JAVA_TOOLCACHE_PATH}/${fullJavaVersion}"
|
javaToolcacheVersionPath="${JAVA_TOOLCACHE_PATH}/${fullJavaVersion}"
|
||||||
mkdir -p "${javaToolcacheVersionPath}"
|
mkdir -p "${javaToolcacheVersionPath}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user