HHH-17239 Automate maintenance releases

This commit is contained in:
Christian Beikov 2023-09-21 18:20:21 +02:00
parent 6e727b6fe4
commit 622adac1b5
8 changed files with 666 additions and 7 deletions

2
.release/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# The folder into which we checkout our release scripts into
*

207
ci/release/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,207 @@
#! /usr/bin/groovy
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
/*
* See https://github.com/hibernate/hibernate-jenkins-pipeline-helpers
*/
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'ABORTED'
return
}
env.PROJECT = "orm"
env.JIRA_KEY = "HHH"
pipeline {
agent {
label 'Worker&&Containers'
}
tools {
jdk 'OpenJDK 11 Latest'
}
options {
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
rateLimitBuilds(throttle: [count: 1, durationName: 'day', userBoost: true])
disableConcurrentBuilds(abortPrevious: false)
preserveStashes()
}
parameters {
string(
name: 'RELEASE_VERSION',
defaultValue: '',
description: 'The version to be released, e.g. 6.2.1.Final.',
trim: true
)
string(
name: 'DEVELOPMENT_VERSION',
defaultValue: '',
description: 'The next version to be used after the release, e.g. 6.2.2-SNAPSHOT.',
trim: true
)
booleanParam(
name: 'RELEASE_DRY_RUN',
defaultValue: false,
description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.'
)
}
stages {
stage('Release check') {
steps {
script {
dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
}
// Determine version information for release process
env.CURRENT_VERSION = sh(
script: ".release/scripts/determine-current-version.sh ${env.PROJECT}",
returnStdout: true
).trim()
if ( params.RELEASE_VERSION == null || params.RELEASE_VERSION.isEmpty() ) {
env.RELEASE_VERSION = sh(
script: ".release/scripts/determine-release-version.sh ${env.CURRENT_VERSION}",
returnStdout: true
).trim()
}
else {
env.RELEASE_VERSION = params.RELEASE_VERSION
}
if ( params.DEVELOPMENT_VERSION == null || params.DEVELOPMENT_VERSION.isEmpty() ) {
env.DEVELOPMENT_VERSION = sh(
script: ".release/scripts/determine-development-version.sh ${env.RELEASE_VERSION}",
returnStdout: true
).trim()
}
else {
env.DEVELOPMENT_VERSION = params.DEVELOPMENT_VERSION
}
env.VERSION_BASIS = sh(
script: ".release/scripts/determine-version-basis.sh ${env.RELEASE_VERSION}",
returnStdout: true
).trim()
env.VERSION_FAMILY = sh(
script: ".release/scripts/determine-version-family.sh ${env.RELEASE_VERSION}",
returnStdout: true
).trim()
env.NEXT_VERSION_BASIS = sh(
script: ".release/scripts/determine-version-basis.sh ${env.DEVELOPMENT_VERSION}",
returnStdout: true
).trim()
env.SCRIPT_OPTIONS = params.RELEASE_DRY_RUN ? "-d" : ""
echo "Workspace version: ${env.CURRENT_VERSION}"
echo "Release version: ${env.RELEASE_VERSION}"
echo "Development version: ${env.DEVELOPMENT_VERSION}"
echo "Version family: ${env.VERSION_FAMILY}"
// Determine version id to check if Jira version exists
sh(script: ".release/scripts/determine-jira-version-id.sh ${env.JIRA_KEY} ${env.VERSION_BASIS}", returnStdout: true)
}
}
}
stage('Release prepare') {
steps {
script {
dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
}
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"), configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")]) {
withCredentials([
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USER'),
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'PLUGIN_PORTAL_PASSWORD', usernameVariable: 'PLUGIN_PORTAL_USERNAME'),
file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
string(credentialsId: 'release.gpg.passphrase', variable: 'RELEASE_GPG_PASSPHRASE')
]) {
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
// set release version
// update changelog from JIRA
// tags the version
// changes the version to the provided development version
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
}
}
}
}
}
}
// Done through Jira Automation
// stage('Jira release') {
// steps {
// script {
// dir('.release/scripts') {
// checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
// }
// withCredentials([usernameColonPassword(credentialsId: 'jira-automation', variable: 'JIRA_API_TOKEN')]) {
// sh ".release/scripts/jira-release.sh ${env.SCRIPT_OPTIONS} ${env.JIRA_KEY} ${env.VERSION_BASIS} ${env.NEXT_VERSION_BASIS}"
// }
// }
// }
// }
stage('Publish release') {
steps {
script {
dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
}
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"), configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")]) {
withCredentials([
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USER'),
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'PLUGIN_PORTAL_PASSWORD', usernameVariable: 'PLUGIN_PORTAL_USERNAME'),
file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'), string(credentialsId: 'release.gpg.passphrase', variable: 'RELEASE_GPG_PASSPHRASE')
]) {
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
// performs documentation upload and Sonatype release
// push to github
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.VERSION_BASIS} ${env.NEXT_VERSION_BASIS}"
}
}
}
}
}
}
stage('Website release') {
steps {
script {
dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
}
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"), configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")]) {
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
dir('.release/hibernate.org') {
checkout scmGit(branches: [[name: '*/production']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']])
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.VERSION_BASIS}"
}
}
}
}
}
}
stage('GitHub release') {
steps {
script {
dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
}
withCredentials([string(credentialsId: 'Hibernate-CI.github.com', variable: 'GITHUB_API_TOKEN')]) {
sh ".release/scripts/github-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
}
}
}
}
}
post {
always {
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
}
}
}
}

View File

@ -36,13 +36,13 @@ tasks.named( "javadoc", Javadoc ) {
stylesheetFile = rootProject.file( "shared/javadoc/stylesheet.css" ) stylesheetFile = rootProject.file( "shared/javadoc/stylesheet.css" )
bottom = "Copyright &copy; 2001-$currentYear <a href=\"https://redhat.com\">Red Hat, Inc.</a> All Rights Reserved." bottom = "Copyright &copy; 2001-$currentYear <a href=\"https://redhat.com\">Red Hat, Inc.</a> All Rights Reserved."
links = [ // The javadoc folder contains cached versions of the respective element-list files to avoid release issues when servers are down
'https://docs.oracle.com/en/java/javase/11/docs/api/', // When upgrading versions of the libraries, don't forget to update the file contents in the repository
'https://jakarta.ee/specifications/bean-validation/3.0/apidocs/', linksOffline 'https://docs.oracle.com/en/java/javase/11/docs/api/', "${project.rootDir}/javadoc/javase11"
'https://jakarta.ee/specifications/cdi/4.0/apidocs/', linksOffline 'https://jakarta.ee/specifications/bean-validation/3.0/apidocs/', "${project.rootDir}/javadoc/jakarta-validation-3.0"
'https://jakarta.ee/specifications/platform/9/apidocs/', linksOffline 'https://jakarta.ee/specifications/cdi/4.0/apidocs/', "${project.rootDir}/javadoc/jakarta-cdi-4.0"
'https://www.javadoc.io/doc/javax.cache/cache-api/1.0.0/' linksOffline 'https://jakarta.ee/specifications/platform/9/apidocs/', "${project.rootDir}/javadoc/jakarta-platform-9"
] linksOffline 'https://www.javadoc.io/doc/javax.cache/cache-api/1.0.0/', "${project.rootDir}/javadoc/javax-cache-1.0"
tags( tags(
'todo:X', 'todo:X',

View File

@ -0,0 +1,17 @@
module:jakarta.cdi
jakarta.decorator
jakarta.enterprise.context
jakarta.enterprise.context.control
jakarta.enterprise.context.spi
jakarta.enterprise.event
jakarta.enterprise.inject
jakarta.enterprise.inject.build.compatible.spi
jakarta.enterprise.inject.literal
jakarta.enterprise.inject.se
jakarta.enterprise.inject.spi
jakarta.enterprise.inject.spi.configurator
jakarta.enterprise.util
module:jakarta.cdi.lang.model
jakarta.enterprise.lang.model
jakarta.enterprise.lang.model.declarations
jakarta.enterprise.lang.model.types

View File

@ -0,0 +1,133 @@
jakarta.activation
jakarta.annotation
jakarta.annotation.security
jakarta.annotation.sql
jakarta.batch.api
jakarta.batch.api.chunk
jakarta.batch.api.chunk.listener
jakarta.batch.api.listener
jakarta.batch.api.partition
jakarta.batch.operations
jakarta.batch.runtime
jakarta.batch.runtime.context
jakarta.decorator
jakarta.ejb
jakarta.ejb.embeddable
jakarta.ejb.spi
jakarta.el
jakarta.enterprise.concurrent
jakarta.enterprise.context
jakarta.enterprise.context.control
jakarta.enterprise.context.spi
jakarta.enterprise.event
jakarta.enterprise.inject
jakarta.enterprise.inject.literal
jakarta.enterprise.inject.se
jakarta.enterprise.inject.spi
jakarta.enterprise.inject.spi.configurator
jakarta.enterprise.util
jakarta.faces
jakarta.faces.annotation
jakarta.faces.application
jakarta.faces.bean
jakarta.faces.component
jakarta.faces.component.behavior
jakarta.faces.component.html
jakarta.faces.component.search
jakarta.faces.component.visit
jakarta.faces.context
jakarta.faces.convert
jakarta.faces.el
jakarta.faces.event
jakarta.faces.flow
jakarta.faces.flow.builder
jakarta.faces.lifecycle
jakarta.faces.model
jakarta.faces.push
jakarta.faces.render
jakarta.faces.validator
jakarta.faces.view
jakarta.faces.view.facelets
jakarta.faces.webapp
jakarta.inject
jakarta.interceptor
jakarta.jms
jakarta.json
jakarta.json.bind
jakarta.json.bind.adapter
jakarta.json.bind.annotation
jakarta.json.bind.config
jakarta.json.bind.serializer
jakarta.json.bind.spi
jakarta.json.spi
jakarta.json.stream
jakarta.jws
jakarta.jws.soap
jakarta.mail
jakarta.mail.event
jakarta.mail.internet
jakarta.mail.search
jakarta.mail.util
jakarta.persistence
jakarta.persistence.criteria
jakarta.persistence.metamodel
jakarta.persistence.spi
jakarta.resource
jakarta.resource.cci
jakarta.resource.spi
jakarta.resource.spi.endpoint
jakarta.resource.spi.security
jakarta.resource.spi.work
jakarta.security.auth.message
jakarta.security.auth.message.callback
jakarta.security.auth.message.config
jakarta.security.auth.message.module
jakarta.security.enterprise
jakarta.security.enterprise.authentication.mechanism.http
jakarta.security.enterprise.credential
jakarta.security.enterprise.identitystore
jakarta.security.jacc
jakarta.servlet
jakarta.servlet.annotation
jakarta.servlet.descriptor
jakarta.servlet.http
jakarta.servlet.jsp
jakarta.servlet.jsp.el
jakarta.servlet.jsp.jstl.core
jakarta.servlet.jsp.jstl.fmt
jakarta.servlet.jsp.jstl.sql
jakarta.servlet.jsp.jstl.tlv
jakarta.servlet.jsp.tagext
jakarta.transaction
jakarta.validation
jakarta.validation.bootstrap
jakarta.validation.constraints
jakarta.validation.constraintvalidation
jakarta.validation.executable
jakarta.validation.groups
jakarta.validation.metadata
jakarta.validation.spi
jakarta.validation.valueextraction
jakarta.websocket
jakarta.websocket.server
jakarta.ws.rs
jakarta.ws.rs.client
jakarta.ws.rs.container
jakarta.ws.rs.core
jakarta.ws.rs.ext
jakarta.ws.rs.sse
jakarta.xml.bind
jakarta.xml.bind.annotation
jakarta.xml.bind.annotation.adapters
jakarta.xml.bind.attachment
jakarta.xml.bind.helpers
jakarta.xml.bind.util
jakarta.xml.soap
jakarta.xml.ws
jakarta.xml.ws.handler
jakarta.xml.ws.handler.soap
jakarta.xml.ws.http
jakarta.xml.ws.soap
jakarta.xml.ws.spi
jakarta.xml.ws.spi.http
jakarta.xml.ws.wsaddressing

View File

@ -0,0 +1,9 @@
jakarta.validation
jakarta.validation.bootstrap
jakarta.validation.constraints
jakarta.validation.constraintvalidation
jakarta.validation.executable
jakarta.validation.groups
jakarta.validation.metadata
jakarta.validation.spi
jakarta.validation.valueextraction

View File

@ -0,0 +1,282 @@
module:java.base
java.io
java.lang
java.lang.annotation
java.lang.invoke
java.lang.module
java.lang.ref
java.lang.reflect
java.math
java.net
java.net.spi
java.nio
java.nio.channels
java.nio.channels.spi
java.nio.charset
java.nio.charset.spi
java.nio.file
java.nio.file.attribute
java.nio.file.spi
java.security
java.security.acl
java.security.cert
java.security.interfaces
java.security.spec
java.text
java.text.spi
java.time
java.time.chrono
java.time.format
java.time.temporal
java.time.zone
java.util
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks
java.util.function
java.util.jar
java.util.regex
java.util.spi
java.util.stream
java.util.zip
javax.crypto
javax.crypto.interfaces
javax.crypto.spec
javax.net
javax.net.ssl
javax.security.auth
javax.security.auth.callback
javax.security.auth.login
javax.security.auth.spi
javax.security.auth.x500
javax.security.cert
module:java.compiler
javax.annotation.processing
javax.lang.model
javax.lang.model.element
javax.lang.model.type
javax.lang.model.util
javax.tools
module:java.datatransfer
java.awt.datatransfer
module:java.desktop
java.applet
java.awt
java.awt.color
java.awt.desktop
java.awt.dnd
java.awt.event
java.awt.font
java.awt.geom
java.awt.im
java.awt.im.spi
java.awt.image
java.awt.image.renderable
java.awt.print
java.beans
java.beans.beancontext
javax.accessibility
javax.imageio
javax.imageio.event
javax.imageio.metadata
javax.imageio.plugins.bmp
javax.imageio.plugins.jpeg
javax.imageio.plugins.tiff
javax.imageio.spi
javax.imageio.stream
javax.print
javax.print.attribute
javax.print.attribute.standard
javax.print.event
javax.sound.midi
javax.sound.midi.spi
javax.sound.sampled
javax.sound.sampled.spi
javax.swing
javax.swing.border
javax.swing.colorchooser
javax.swing.event
javax.swing.filechooser
javax.swing.plaf
javax.swing.plaf.basic
javax.swing.plaf.metal
javax.swing.plaf.multi
javax.swing.plaf.nimbus
javax.swing.plaf.synth
javax.swing.table
javax.swing.text
javax.swing.text.html
javax.swing.text.html.parser
javax.swing.text.rtf
javax.swing.tree
javax.swing.undo
module:java.instrument
java.lang.instrument
module:java.logging
java.util.logging
module:java.management
java.lang.management
javax.management
javax.management.loading
javax.management.modelmbean
javax.management.monitor
javax.management.openmbean
javax.management.relation
javax.management.remote
javax.management.timer
module:java.management.rmi
javax.management.remote.rmi
module:java.naming
javax.naming
javax.naming.directory
javax.naming.event
javax.naming.ldap
javax.naming.spi
module:java.net.http
java.net.http
module:java.prefs
java.util.prefs
module:java.rmi
java.rmi
java.rmi.activation
java.rmi.dgc
java.rmi.registry
java.rmi.server
javax.rmi.ssl
module:java.scripting
javax.script
module:java.se
module:java.security.jgss
javax.security.auth.kerberos
org.ietf.jgss
module:java.security.sasl
javax.security.sasl
module:java.smartcardio
javax.smartcardio
module:java.sql
java.sql
javax.sql
module:java.sql.rowset
javax.sql.rowset
javax.sql.rowset.serial
javax.sql.rowset.spi
module:java.transaction.xa
javax.transaction.xa
module:java.xml
javax.xml
javax.xml.catalog
javax.xml.datatype
javax.xml.namespace
javax.xml.parsers
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform
javax.xml.transform.dom
javax.xml.transform.sax
javax.xml.transform.stax
javax.xml.transform.stream
javax.xml.validation
javax.xml.xpath
org.w3c.dom
org.w3c.dom.bootstrap
org.w3c.dom.events
org.w3c.dom.ls
org.w3c.dom.ranges
org.w3c.dom.traversal
org.w3c.dom.views
org.xml.sax
org.xml.sax.ext
org.xml.sax.helpers
module:java.xml.crypto
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
module:jdk.accessibility
com.sun.java.accessibility.util
module:jdk.attach
com.sun.tools.attach
com.sun.tools.attach.spi
module:jdk.charsets
module:jdk.compiler
com.sun.source.doctree
com.sun.source.tree
com.sun.source.util
com.sun.tools.javac
module:jdk.crypto.cryptoki
module:jdk.crypto.ec
module:jdk.dynalink
jdk.dynalink
jdk.dynalink.beans
jdk.dynalink.linker
jdk.dynalink.linker.support
jdk.dynalink.support
module:jdk.editpad
module:jdk.hotspot.agent
module:jdk.httpserver
com.sun.net.httpserver
com.sun.net.httpserver.spi
module:jdk.jartool
com.sun.jarsigner
jdk.security.jarsigner
module:jdk.javadoc
com.sun.javadoc
com.sun.tools.javadoc
jdk.javadoc.doclet
module:jdk.jcmd
module:jdk.jconsole
com.sun.tools.jconsole
module:jdk.jdeps
module:jdk.jdi
com.sun.jdi
com.sun.jdi.connect
com.sun.jdi.connect.spi
com.sun.jdi.event
com.sun.jdi.request
module:jdk.jdwp.agent
module:jdk.jfr
jdk.jfr
jdk.jfr.consumer
module:jdk.jlink
module:jdk.jshell
jdk.jshell
jdk.jshell.execution
jdk.jshell.spi
jdk.jshell.tool
module:jdk.jsobject
netscape.javascript
module:jdk.jstatd
module:jdk.localedata
module:jdk.management
com.sun.management
module:jdk.management.agent
module:jdk.management.jfr
jdk.management.jfr
module:jdk.naming.dns
module:jdk.naming.rmi
module:jdk.net
jdk.net
jdk.nio
module:jdk.pack
module:jdk.rmic
module:jdk.scripting.nashorn
jdk.nashorn.api.scripting
jdk.nashorn.api.tree
module:jdk.sctp
com.sun.nio.sctp
module:jdk.security.auth
com.sun.security.auth
com.sun.security.auth.callback
com.sun.security.auth.login
com.sun.security.auth.module
module:jdk.security.jgss
com.sun.security.jgss
module:jdk.xml.dom
org.w3c.dom.css
org.w3c.dom.html
org.w3c.dom.stylesheets
org.w3c.dom.xpath
module:jdk.zipfs

View File

@ -0,0 +1,9 @@
javax.cache
javax.cache.annotation
javax.cache.configuration
javax.cache.event
javax.cache.expiry
javax.cache.integration
javax.cache.management
javax.cache.processor
javax.cache.spi