diff --git a/build.gradle.kts b/build.gradle.kts index 3348575..70f298b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -122,9 +122,10 @@ publishing { signing { setRequired(providers.environmentVariable("CI").orNull) + val signingKeyId: String? by project val signingKey: String? by project val signingPassphrase: String? by project - useInMemoryPgpKeys(signingKey, signingPassphrase) + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassphrase) sign(publishing.publications) } diff --git a/src/main/java/org/ajoberstar/gradle/defaults/MavenCentralConventionPlugin.java b/src/main/java/org/ajoberstar/gradle/defaults/MavenCentralConventionPlugin.java index 25043ef..ce2c063 100644 --- a/src/main/java/org/ajoberstar/gradle/defaults/MavenCentralConventionPlugin.java +++ b/src/main/java/org/ajoberstar/gradle/defaults/MavenCentralConventionPlugin.java @@ -91,11 +91,12 @@ private void configurePom(Project project, PublishingExtension publishing, Maven private void enableSigning(Project project, SigningExtension signing, PublishingExtension publishing) { var isCi = project.getProviders().environmentVariable("CI"); + var signingKeyId = project.getProviders().gradleProperty("signingKeyId"); var signingKey = project.getProviders().gradleProperty("signingKey"); var signingPassphrase = project.getProviders().gradleProperty("signingPassphrase"); signing.setRequired(isCi.getOrNull()); - signing.useInMemoryPgpKeys(signingKey.getOrNull(), signingPassphrase.getOrNull()); + signing.useInMemoryPgpKeys(signingKeyId.getOrNull(), signingKey.getOrNull(), signingPassphrase.getOrNull()); signing.sign(publishing.getPublications()); } }