diff --git a/build.gradle b/build.gradle index 4ba220d..0e5435a 100644 --- a/build.gradle +++ b/build.gradle @@ -103,8 +103,8 @@ publishing { repositories { maven { credentials { - username = "$ossrhUsername" - password = "$ossrhPassword" + username = project.properties['ossrhUsername'] ?: System.getenv('ossrhUsername') + password = project.properties['ossrhPassword'] ?: System.getenv('ossrhPassword') } url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" @@ -114,6 +114,9 @@ publishing { } signing { + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + useInMemoryPgpKeys(signingKey, signingPassword) sign publishing.publications.shadow } @@ -122,8 +125,8 @@ nexusPublishing { sonatype { nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - username = "$ossrhUsername" - password = "$ossrhPassword" + username = project.properties['ossrhUsername'] ?: System.getenv('ossrhUsername') + password = project.properties['ossrhPassword'] ?: System.getenv('ossrhPassword') } } }