Skip to content

Commit afe95c1

Browse files
sebersolebeikov
authored andcommitted
1 parent 9b523fe commit afe95c1

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ tasks.register('publish') {
6363

6464
nexusPublishing {
6565
repositories {
66-
sonatype
66+
sonatype()
6767
}
6868
}
6969

ci/release/Jenkinsfile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ pipeline {
9292
stage('Release check') {
9393
steps {
9494
script {
95-
print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}"
96-
print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}"
97-
print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}"
95+
print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}"
96+
print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}"
97+
print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}"
9898

9999
checkoutReleaseScripts()
100100

@@ -167,19 +167,20 @@ pipeline {
167167
configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"),
168168
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")
169169
]) {
170-
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
171-
// set release version
172-
// update changelog from JIRA
173-
// tags the version
174-
// changes the version to the provided development version
175-
withEnv([
176-
"BRANCH=${env.GIT_BRANCH}",
177-
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
178-
"GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
179-
]) {
180-
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
181-
}
182-
}
170+
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
171+
// set release version
172+
// update changelog from JIRA
173+
// tags the version
174+
// changes the version to the provided development version
175+
withEnv([
176+
"BRANCH=${env.GIT_BRANCH}",
177+
"DISABLE_REMOTE_GRADLE_CACHE=true",
178+
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
179+
"GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
180+
]) {
181+
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
182+
}
183+
}
183184
}
184185
}
185186
}

ci/snapshot-publish.Jenkinsfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,20 @@ pipeline {
3030
}
3131
stage('Publish') {
3232
steps {
33-
withCredentials([
34-
usernamePassword(credentialsId: 'ossrh.sonatype.org', usernameVariable: 'hibernatePublishUsername', passwordVariable: 'hibernatePublishPassword'),
35-
usernamePassword(credentialsId: 'plugins.gradle.org', usernameVariable: 'hibernatePluginPortalUsername', passwordVariable: 'hibernatePluginPortalPassword'),
36-
string(credentialsId: 'ge.hibernate.org-access-key', variable: 'GRADLE_ENTERPRISE_ACCESS_KEY'),
37-
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'),
38-
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING')
39-
]) {
40-
sh '''./gradlew clean publish \
41-
-PhibernatePublishUsername=$hibernatePublishUsername \
42-
-PhibernatePublishPassword=$hibernatePublishPassword \
43-
-Pgradle.publish.key=$hibernatePluginPortalUsername \
44-
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
45-
--no-scan \
46-
-DsigningPassword=$SIGNING_PASS \
47-
-DsigningKeyFile=$SIGNING_KEYRING \
48-
'''
33+
withCredentials([
34+
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
35+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_sonatypePassword', usernameVariable: 'ORG_GRADLE_PROJECT_sonatypeUsername'),
36+
// https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#account_setup
37+
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),
38+
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_GPG_PRIVATE_KEY_PATH'),
39+
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_GPG_PASSPHRASE')
40+
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default')
41+
]) {
42+
withEnv([
43+
"DISABLE_REMOTE_GRADLE_CACHE=true"
44+
]) {
45+
sh './gradlew clean publish -x test --no-scan --no-daemon --no-build-cache --stacktrace'
46+
}
4947
}
5048
}
5149
}

0 commit comments

Comments
 (0)