Fix signing for releases (#3174)
* Fix publication plugin to look for the correctly-named properties
* try new secrets
* fix check for `useGpgCommand`
* Revert "try new secrets"
This reverts commit e6a96cf5eda7543599de1d5d7258ff40913db7d4.
diff --git a/build-logic/src/main/kotlin/PublicationPlugin.kt b/build-logic/src/main/kotlin/PublicationPlugin.kt
index 7115f81..4825cfe 100644
--- a/build-logic/src/main/kotlin/PublicationPlugin.kt
+++ b/build-logic/src/main/kotlin/PublicationPlugin.kt
@@ -31,9 +31,9 @@
// Pass `-PuseGpgCmd` to sign artifacts using local gpg agent
val useGpgCmd = localGradleProperty("useGpgCmd").orNull
- val signingKeyId = localGradleProperty("signingKeyId").orNull?.takeIf { it.isNotEmpty() }
- val signingKey = localGradleProperty("signingKey").orNull?.takeIf { it.isNotEmpty() }
- val signingPassword = localGradleProperty("signingKeyPassword").orNull?.takeIf { it.isNotEmpty() }
+ val signingKeyId = localGradleProperty("signingInMemoryKeyId").orNull?.takeIf { it.isNotEmpty() }
+ val signingKey = localGradleProperty("signingInMemoryKey").orNull?.takeIf { it.isNotEmpty() }
+ val signingPassword = localGradleProperty("signingInMemoryKeyPassword").orNull?.takeIf { it.isNotEmpty() }
val signingConfigPresent = signingKeyId != null && signingKey != null && signingPassword != null
// Avoid setting empty strings as signing keys. This avoids breaking the build when PR is opened from a fork.
@@ -45,7 +45,7 @@
configure<SigningExtension> {
isRequired = signingConfigPresent // for more reproducible builds, fail if SNAPSHOT builds are misconfigured too
- if (useGpgCmd != "false") {
+ if (useGpgCmd != null && useGpgCmd != "false") {
useGpgCmd()
}
}