Skip to content

Commit a4fd069

Browse files
authored
misc: stop using JReleaser environment variables in configurePublishing (#146)
1 parent b818cd2 commit a4fd069

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
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

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/publishing/SonatypeCentralPortalWaitForPublicationTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class SonatypeCentralPortalWaitForPublicationTask : DefaultTask() {
2424
abstract val deploymentId: Property<String>
2525

2626
@Option(option = "deploymentId", description = "Deployment ID to wait for")
27-
fun setDeploymentId(id: String) {
27+
fun setDeploymentIdFromOption(id: String) {
2828
deploymentId.set(id)
2929
}
3030

0 commit comments

Comments
 (0)