diff --git a/Jenkinsfile b/Jenkinsfile
index 73e8980..ec12623 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,4 +1,4 @@
-@Library('hibernate-jenkins-pipeline-helpers@1.5') _
+@Library('hibernate-jenkins-pipeline-helpers@1.17') _
import org.hibernate.jenkins.pipeline.helpers.version.Version
@@ -14,25 +14,6 @@ pipeline {
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
disableConcurrentBuilds(abortPrevious: false)
}
- parameters {
- string(
- name: 'RELEASE_VERSION',
- defaultValue: '',
- description: 'The version to be released, e.g. 1.0.0.Final.',
- trim: true
- )
- string(
- name: 'DEVELOPMENT_VERSION',
- defaultValue: '',
- description: 'The next version to be used after the release, e.g. 1.0.1-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.'
- )
- }
stages {
stage('Build') {
steps {
@@ -41,47 +22,5 @@ pipeline {
}
}
}
- stage('Release') {
- when {
- beforeAgent true
- // Releases must be triggered explicitly with parameters
- expression { return params.RELEASE_VERSION }
- }
- steps {
- script {
- // Check that all the necessary parameters are set
- if (!params.RELEASE_VERSION) {
- throw new IllegalArgumentException("Missing value for parameter RELEASE_VERSION.")
- }
- if (!params.DEVELOPMENT_VERSION) {
- throw new IllegalArgumentException("Missing value for parameter DEVELOPMENT_VERSION.")
- }
-
- def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION)
- def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)
- echo "Performing full release for version ${releaseVersion.toString()}"
-
- withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
- mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
- 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']) {
- sh 'cat $HOME/.ssh/config'
- sh """ \
- ./mvnw release:prepare \
- -Dtag=${releaseVersion.toString()} \
- -DreleaseVersion=${releaseVersion.toString()} \
- -DdevelopmentVersion=${developmentVersion.toString()} \
- -Prelease \
- """
- sh """ \
- ./mvnw release:perform ${params.RELEASE_DRY_RUN ? '-DdryRun' : ''} -Prelease \
- """
- }
- }
- }
- }
- }
- }
}
-}
\ No newline at end of file
+}
diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile
new file mode 100644
index 0000000..8bfad4b
--- /dev/null
+++ b/ci/release/Jenkinsfile
@@ -0,0 +1,81 @@
+@Library('hibernate-jenkins-pipeline-helpers@1.17') _
+
+import org.hibernate.jenkins.pipeline.helpers.version.Version
+
+pipeline {
+ agent {
+ label 'Worker&&Containers'
+ }
+ tools {
+ maven 'Apache Maven 3.8'
+ jdk 'OpenJDK 17 Latest'
+ }
+ options {
+ buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
+ disableConcurrentBuilds(abortPrevious: false)
+ }
+ parameters {
+ string(
+ name: 'RELEASE_VERSION',
+ defaultValue: '',
+ description: 'The version to be released, e.g. 1.0.0.Final.',
+ trim: true
+ )
+ string(
+ name: 'DEVELOPMENT_VERSION',
+ defaultValue: '',
+ description: 'The next version to be used after the release, e.g. 1.0.1-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.'
+ )
+ }
+ stages {
+ stage('Release') {
+ when {
+ beforeAgent true
+ // Releases must be triggered explicitly with parameters
+ expression { return params.RELEASE_VERSION }
+ }
+ steps {
+ script {
+ // Check that all the necessary parameters are set
+ if (!params.RELEASE_VERSION) {
+ throw new IllegalArgumentException("Missing value for parameter RELEASE_VERSION.")
+ }
+ if (!params.DEVELOPMENT_VERSION) {
+ throw new IllegalArgumentException("Missing value for parameter DEVELOPMENT_VERSION.")
+ }
+
+ def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION)
+ def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)
+ echo "Performing full release for version ${releaseVersion.toString()}"
+
+ withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
+ mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
+ configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: env.HOME + '/.ssh/config'),
+ configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) {
+ // using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin)
+ withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
+ string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
+ sshagent(['ed25519.Hibernate-CI.github.com']) {
+ sh 'mvn -v'
+ sh 'cat $HOME/.ssh/config'
+ sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git'
+ env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg'
+ sh """
+ bash -xe hibernate-release-scripts/release.sh ${params.RELEASE_DRY_RUN ? '-d' : ''} \
+ infra-develocity ${releaseVersion.toString()} ${developmentVersion.toString()}
+ """
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/pom.xml b/pom.xml
index 7322f35..7a7eee1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,11 +22,13 @@
17
17
true
- 3.1.1
1.7.0
3.11.1
3.3.1
3.6.0
+ 3.2.7
+
+ true
ossrh
@@ -152,6 +154,25 @@
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${version.gpg.plugin}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+ ${gpg.sign.skip}
+ ${env.RELEASE_GPG_HOMEDIR}
+ true
+
+
+
+
@@ -206,18 +227,17 @@
release
+
+
+ performRelease
+ true
+
+
+
+ false
+
-
- org.apache.maven.plugins
- maven-release-plugin
- ${maven-release-plugin.version}
-
- true
- @{project.version}
- true
-
-
org.sonatype.plugins
nexus-staging-maven-plugin