@@ -30,22 +30,20 @@ pipeline {
30
30
}
31
31
stage('Publish') {
32
32
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
+ }
49
47
}
50
48
}
51
49
}
0 commit comments