Skip to content

Commit bf25071

Browse files
committed
build: support publishing artifacts from local env
1 parent 8f89705 commit bf25071

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

client/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ publishing {
111111
// def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
112112
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
113113
credentials {
114-
115114
username = project.hasProperty('ossrhUsername') ? ossrhUsername : System.getenv("OSSRH_USERNAME")
116115
password = project.hasProperty('ossrhPassword') ? ossrhPassword : System.getenv("OSSRH_TOKEN")
117116
}
@@ -120,10 +119,14 @@ publishing {
120119
}
121120

122121
signing {
123-
def signingKey = System.getenv("OSSRH_GPG_SECRET_KEY")
124-
def signingPassword = System.getenv("OSSRH_GPG_PASSWORD")
125-
useInMemoryPgpKeys(signingKey, signingPassword)
126-
sign publishing.publications.mavenJava
122+
if(project.hasProperty('signing.keyId')) {
123+
sign publishing.publications.mavenJava
124+
} else {
125+
def signingKey = System.getenv("OSSRH_GPG_SECRET_KEY")
126+
def signingPassword = System.getenv("OSSRH_GPG_PASSWORD")
127+
useInMemoryPgpKeys(signingKey, signingPassword)
128+
sign publishing.publications.mavenJava
129+
}
127130
}
128131

129132

0 commit comments

Comments
 (0)