Skip to content

Commit

Permalink
Add code to support publishing ea builds of JDK21 (#740)
Browse files Browse the repository at this point in the history
* Fix weekly check logic

* Add login to be able to auto-publish JDK22 ea builds

* Fixes following linting/review

* Fixup whitespace

Signed-off-by: Stewart X Addison <[email protected]>

* Adjust for JDK21 and 22

Signed-off-by: Stewart X Addison <[email protected]>

* Adjust tag logic to handle publish of JDK21 weekly builds

Signed-off-by: Stewart X Addison <[email protected]>

* Updates following review

Signed-off-by: Stewart X Addison <[email protected]>

* Update build_base_file.groovy

---------

Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Nov 13, 2023
1 parent ac55a91 commit c0aa508
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -771,16 +771,36 @@ class Builder implements Serializable {
tag = publishName
}

// Definition of filenames when building an EA tag. This is passed
// to the release tool in place of the "TIMESTAMP" Criteria for this:
// JDK21 or 22 when a scmRef (tag) is specified and it's not a release build
if ((javaVersion=="jdk21" || javaVersion=="jdk22") && 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)],
context.string(name: 'TAG', value: tag),
context.string(name: 'TIMESTAMP', value: timestamp),
['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: false],
context.string(name: 'TAG', value: ((scmReference && (javaVersion=="jdk21" || javaVersion=="jdk22"))?(scmReference.replace('_adopt','')):tag)),
context.string(name: 'TIMESTAMP', value: ((scmRefetence && (javaVersion=="jdk21" || javaVersion=="jdk22"))?publishName:timestamp)),
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

0 comments on commit c0aa508

Please sign in to comment.