diff --git a/publish-root.gradle b/publish-root.gradle index 7cbd261..2c5fae8 100644 --- a/publish-root.gradle +++ b/publish-root.gradle @@ -6,6 +6,7 @@ ext["signing.key"] = '' ext["ossrhUsername"] = '' ext["ossrhPassword"] = '' ext["sonatypeStagingProfileId"] = '' +ext["snapshot"] = 'true' File secretPropsFile = project.rootProject.file('local.properties') if (secretPropsFile.exists()) { diff --git a/publishing.gradle b/publishing.gradle index c49009d..02ec1f5 100644 --- a/publishing.gradle +++ b/publishing.gradle @@ -79,12 +79,17 @@ afterEvaluate { } } signing { - useInMemoryPgpKeys( - rootProject.ext["signing.keyId"], - rootProject.ext["signing.key"], - rootProject.ext["signing.password"], - ) - sign publishing.publications + if (rootProject.ext["signing.keyId"] && rootProject.ext["signing.key"] && rootProject.ext["signing.password"]) { + useInMemoryPgpKeys( + rootProject.ext["signing.keyId"], + rootProject.ext["signing.key"], + rootProject.ext["signing.password"], + ) + sign publishing.publications + + } else { + sign configurations.archives + } } java { sourceCompatibility = JavaVersion.VERSION_1_8