Skip to content

Commit 9e1b759

Browse files
committed
Stop using JReleaser environment variables in configurePublishing
1 parent b818cd2 commit 9e1b759

File tree

1 file changed

+8
-2
lines changed
  • build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl

1 file changed

+8
-2
lines changed

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl/Publish.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private const val SIGNING_PASSWORD_PROP = "signingPassword"
3232
private const val SONATYPE_USERNAME_PROP = "sonatypeUsername"
3333
private const val SONATYPE_PASSWORD_PROP = "sonatypePassword"
3434

35+
// TODO Remove JReleaser environment variables when smithy-kotlin + aws-crt-kotlin are migrated to custom Sonatype integration
3536
private object EnvironmentVariables {
3637
const val GROUP_ID = "JRELEASER_PROJECT_JAVA_GROUP_ID"
3738
const val MAVEN_CENTRAL_USERNAME = "JRELEASER_MAVENCENTRAL_USERNAME"
@@ -42,6 +43,9 @@ private object EnvironmentVariables {
4243
const val GENERIC_TOKEN = "JRELEASER_GENERIC_TOKEN"
4344
}
4445

46+
private const val SIGNING_PUBLIC_KEY = "SIGNING_KEY"
47+
private const val SIGNING_SECRET_KEY = "SIGNING_PASSWORD"
48+
4549
internal val ALLOWED_PUBLICATION_NAMES = setOf(
4650
"common",
4751
"jvm",
@@ -240,8 +244,8 @@ fun Project.configurePublishing(repoName: String, githubOrganization: String = "
240244
}
241245
}
242246

243-
val secretKey = System.getenv(EnvironmentVariables.GPG_SECRET_KEY)
244-
val passphrase = System.getenv(EnvironmentVariables.GPG_PASSPHRASE)
247+
val secretKey = System.getenv(SIGNING_PUBLIC_KEY)
248+
val passphrase = System.getenv(SIGNING_SECRET_KEY)
245249

246250
if (!secretKey.isNullOrBlank() && !passphrase.isNullOrBlank()) {
247251
apply(plugin = "signing")
@@ -255,6 +259,8 @@ fun Project.configurePublishing(repoName: String, githubOrganization: String = "
255259
tasks.withType<AbstractPublishToMaven>().configureEach {
256260
mustRunAfter(signingTasks)
257261
}
262+
} else {
263+
logger.info("Skipping signing configuration, $SIGNING_PUBLIC_KEY or $SIGNING_SECRET_KEY are not set")
258264
}
259265
}
260266

0 commit comments

Comments
 (0)