Skip to content

Commit f0dbac3

Browse files
committed
ci: new publishing
1 parent d04f0ba commit f0dbac3

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

build.gradle

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,9 @@ buildscript {
99
}
1010

1111
plugins {
12-
id "io.github.gradle-nexus.publish-plugin" version '2.0.0'
12+
id 'org.jreleaser' version '1.20.0'
1313
}
1414

15-
nexusPublishing {
16-
repositories {
17-
sonatype()
18-
}
19-
20-
transitionCheckOptions {
21-
maxRetries.set(180) // 30 minutes
22-
}
23-
}
2415

2516
allprojects {
2617
apply plugin: 'idea'
@@ -42,6 +33,7 @@ allprojects {
4233
}
4334
}
4435

36+
tasks.register('clean') {}
4537

4638
subprojects {
4739
apply plugin: 'java'
@@ -50,7 +42,7 @@ subprojects {
5042

5143
if (!project.hasProperty("notPublished")) {
5244
apply plugin: 'maven-publish'
53-
apply plugin: 'signing'
45+
apply plugin: 'org.jreleaser'
5446
}
5547

5648
group = "com.avast.clients.rabbitmq"
@@ -92,14 +84,42 @@ subprojects {
9284
}
9385
}
9486
}
87+
repositories {
88+
maven {
89+
url = layout.buildDirectory.dir('staging-deploy')
90+
}
91+
}
9592
}
9693
}
9794

98-
signing {
99-
String base64Key = System.getenv('SIGNING_KEY')
100-
if (base64Key) {
101-
useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD'))
102-
sign publishing.publications
95+
jreleaser {
96+
signing {
97+
active = 'ALWAYS'
98+
armored = true
99+
String base64Key = System.getenv('SIGNING_KEY')
100+
if (base64Key) {
101+
secretKey = new String(Base64.decoder.decode(base64Key))
102+
}
103+
String base64PublicKey = System.getenv('SIGNING_PUBLIC_KEY')
104+
if (base64PublicKey) {
105+
publicKey = new String(Base64.decoder.decode(base64PublicKey))
106+
}
107+
}
108+
deploy {
109+
maven {
110+
mavenCentral {
111+
sonatype {
112+
active = 'ALWAYS'
113+
url = 'https://central.sonatype.com/api/v1/publisher'
114+
stagingRepository('build/staging-deploy')
115+
}
116+
}
117+
}
118+
}
119+
release {
120+
github {
121+
enabled = false
122+
}
103123
}
104124
}
105125
}

0 commit comments

Comments
 (0)