Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private const val SIGNING_PASSWORD_PROP = "signingPassword"
private const val SONATYPE_USERNAME_PROP = "sonatypeUsername"
private const val SONATYPE_PASSWORD_PROP = "sonatypePassword"

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

private const val SIGNING_PUBLIC_KEY = "SIGNING_KEY"
private const val SIGNING_SECRET_KEY = "SIGNING_PASSWORD"

internal val ALLOWED_PUBLICATION_NAMES = setOf(
"common",
"jvm",
Expand Down Expand Up @@ -240,8 +244,8 @@ fun Project.configurePublishing(repoName: String, githubOrganization: String = "
}
}

val secretKey = System.getenv(EnvironmentVariables.GPG_SECRET_KEY)
val passphrase = System.getenv(EnvironmentVariables.GPG_PASSPHRASE)
val secretKey = System.getenv(SIGNING_PUBLIC_KEY)
val passphrase = System.getenv(SIGNING_SECRET_KEY)

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class SonatypeCentralPortalWaitForPublicationTask : DefaultTask() {
abstract val deploymentId: Property<String>

@Option(option = "deploymentId", description = "Deployment ID to wait for")
fun setDeploymentId(id: String) {
fun setDeploymentIdFromOption(id: String) {
deploymentId.set(id)
}

Expand Down
Loading