Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code to support publishing ea builds of JDK21 #740

Merged
merged 9 commits into from
Nov 13, 2023
Merged
25 changes: 21 additions & 4 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -765,16 +765,33 @@ class Builder implements Serializable {
tag = publishName
}

if (javaToBuild=="jdk21" && scmReference && !release) {
publishName = scmReference.replace('_adopt','')
def firstDot=publishName.indexOf('.')
def plusSign=publishName.indexOf('+')
def secondDot=publishName.indexOf('.', firstDot+1)
// Translate jdk-AA+BB to jdk-AA-0-BB
// Translate jdk-AA.B.C+DD to jdk-AA-C-DD-ea-beta
// Note that jdk-AA-B-C-D+EE will become jdk-AA-C-D-EE-ea-beta
if ( firstDot==-1 ) {
publishName=publishName.substring(4,plusSign)+'.0.'+publishName.substring(plusSign+1)
} else {
publishName=publishName.substring(4,firstDot)+publishName.substring(secondDot).replace("+","-")
}
publishName='ea_'+publishName.replaceAll("\\.","-")
}

context.stage('publish') {
context.build job: 'build-scripts/release/refactor_openjdk_release_tool',
context.println "publishing with publishName: ${publishName}"
context.build job: 'build-scripts/release/refactor_openjdk_release_tool',
parameters: [
['$class': 'BooleanParameterValue', name: 'RELEASE', value: release],
['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: ((releaseType=="Weekly" && javaVersion=="jdk21") ? true : false)],
andrew-m-leonard marked this conversation as resolved.
Show resolved Hide resolved
context.string(name: 'TAG', value: tag),
context.string(name: 'TIMESTAMP', value: timestamp),
context.string(name: 'TAG', value: (javaToBuild=="jdk21"?(scmReference.replace('_adopt','')):tag)),
andrew-m-leonard marked this conversation as resolved.
Show resolved Hide resolved
context.string(name: 'TIMESTAMP', value: (javaToBuild=="jdk"?publishName:timestamp)),
andrew-m-leonard marked this conversation as resolved.
Show resolved Hide resolved
context.string(name: 'UPSTREAM_JOB_NAME', value: env.JOB_NAME),
context.string(name: 'UPSTREAM_JOB_NUMBER', value: "${currentBuild.getNumber()}"),
context.string(name: 'VERSION', value: javaVersion )
context.string(name: 'VERSION', value: javaVersion)
]
}
}
Expand Down