diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index e58271ff8d62..61eb36301b76 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -137,15 +137,14 @@ afterEvaluate { } } } +} // Sign only if we have a key to do so - val signingKey: String? = System.getenv("GPG_PRIVATE_KEY") -// Stub out entire signing block off of CI since Gradle provides no way of lazy configuration of -// signing tasks. - if (System.getenv("CI") != null && signingKey != null) { - signing { - useInMemoryPgpKeys(signingKey, System.getenv("GPG_PASSWORD")) - sign(publishing.publications["pluginMaven"]) - } - } +val signingKey: String? = System.getenv("GPG_PRIVATE_KEY") +signing { + setRequired({ + // only require signing on CI and when a signing key is present + System.getenv("CI") != null && signingKey != null + }) + useInMemoryPgpKeys(signingKey, System.getenv("GPG_PASSWORD")) } diff --git a/gradle-plugins/settings.gradle.kts b/gradle-plugins/settings.gradle.kts index e70327ddbfa1..111f634d8311 100644 --- a/gradle-plugins/settings.gradle.kts +++ b/gradle-plugins/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { plugins { - id("com.gradle.plugin-publish") version "0.15.0" + id("com.gradle.plugin-publish") version "1.0.0" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } }