From 5932f45bd10906e02474e94aa8c6f31a4e144f1f Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 18 Dec 2024 13:05:43 -0600 Subject: [PATCH] HHH-18912 - ORM release process https://hibernate.atlassian.net/browse/HHH-18912 --- build.gradle | 2 +- ci/release/Jenkinsfile | 6 +++--- ci/snapshot-publish.Jenkinsfile | 27 ++++++++++----------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 8a55176d69e8..85a808b4f54f 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.register('publish') { nexusPublishing { repositories { - sonatype + sonatype() } } diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index a51f954b2e0c..0e909b078bcb 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -57,9 +57,9 @@ pipeline { stage('Release check') { steps { script { - print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}" - print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}" - print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}" + print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}" + print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}" + print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}" // Avoid doing a release for commits from a release def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true).trim() diff --git a/ci/snapshot-publish.Jenkinsfile b/ci/snapshot-publish.Jenkinsfile index 02d1ffb5c2f6..2ab5e6327bf0 100644 --- a/ci/snapshot-publish.Jenkinsfile +++ b/ci/snapshot-publish.Jenkinsfile @@ -30,26 +30,19 @@ pipeline { } stage('Publish') { steps { - withCredentials([ - usernamePassword(credentialsId: 'ossrh.sonatype.org', usernameVariable: 'hibernatePublishUsername', passwordVariable: 'hibernatePublishPassword'), - usernamePassword(credentialsId: 'plugins.gradle.org', usernameVariable: 'hibernatePluginPortalUsername', passwordVariable: 'hibernatePluginPortalPassword'), - string(credentialsId: 'ge.hibernate.org-access-key', variable: 'GRADLE_ENTERPRISE_ACCESS_KEY'), - string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'), - file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING') - ]) { + withCredentials([ + // https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh + usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_sonatypePassword', usernameVariable: 'ORG_GRADLE_PROJECT_sonatypeUsername'), + // https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#account_setup + usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'), + file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_GPG_PRIVATE_KEY_PATH'), + string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_GPG_PASSPHRASE') + gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default') + ]) { withEnv([ "DISABLE_REMOTE_GRADLE_CACHE=true" ]) { - sh '''./gradlew clean publish \ - -PhibernatePublishUsername=$hibernatePublishUsername \ - -PhibernatePublishPassword=$hibernatePublishPassword \ - -Pgradle.publish.key=$hibernatePluginPortalUsername \ - -Pgradle.publish.secret=$hibernatePluginPortalPassword \ - --no-scan \ - --no-build-cache \ - -DsigningPassword=$SIGNING_PASS \ - -DsigningKeyFile=$SIGNING_KEYRING \ - ''' + sh './gradlew clean publish -x test --no-scan --no-daemon --no-build-cache --stacktrace' } } }