Skip to content

Commit d1adffc

Browse files
authored
chore: switch to jreleaser and central.sonatype.com (#216)
1 parent a9001ee commit d1adffc

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

grpc-gcp/build.gradle

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
plugins {
22
id 'java-library'
33
id 'maven-publish'
4-
id 'signing'
54
id 'com.google.protobuf' version '0.9.4'
65
id 'com.github.sherter.google-java-format' version '0.9'
7-
id 'io.codearte.nexus-staging' version '0.30.0'
6+
id 'org.jreleaser' version '1.20.0'
87
}
98

109
repositories {
@@ -89,16 +88,6 @@ task sourcesJar(type: Jar) {
8988
from sourceSets.main.allJava
9089
}
9190

92-
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
93-
// Nexus staging plugin only works at root project level
94-
// See https://github.com/Codearte/gradle-nexus-staging-plugin/issues/47
95-
nexusStaging {
96-
username = ossrhUsername
97-
password = ossrhPassword
98-
packageGroup = group
99-
}
100-
}
101-
10291
publishing {
10392
publications {
10493
maven(MavenPublication) {
@@ -143,21 +132,32 @@ publishing {
143132
}
144133
repositories {
145134
maven {
146-
url 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/'
147-
credentials {
148-
username = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : null
149-
password = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : null
150-
}
135+
url = layout.buildDirectory.dir('staging-deploy')
151136
}
152137
}
153138
}
154139

155-
signing {
156-
if (!project.hasProperty('skip.signing')) {
157-
if (project.hasProperty('signing.gnupg.executable')) {
158-
useGpgCmd()
140+
jreleaser {
141+
gitRootSearch = true
142+
signing {
143+
active = 'ALWAYS'
144+
armored = true
145+
}
146+
deploy {
147+
maven {
148+
mavenCentral {
149+
sonatype {
150+
active = 'ALWAYS'
151+
url = 'https://central.sonatype.com/api/v1/publisher'
152+
stagingRepository('build/staging-deploy')
153+
}
154+
}
155+
}
156+
}
157+
release {
158+
github {
159+
skipRelease = true
159160
}
160-
sign publishing.publications.maven
161161
}
162162
}
163163

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.5-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)