diff --git a/build.gradle.kts b/build.gradle.kts index 48062c13f..7178858af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" id("org.jetbrains.dokka") version "2.0.0" } @@ -39,11 +39,17 @@ tasks.named("dokkaJavadocCollector").configure { nexusPublishing { repositories { sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) - username.set(System.getenv("SONATYPE_USERNAME")) - password.set(System.getenv("SONATYPE_PASSWORD")) + username.set( + (findProperty("mavenCentralUsername") as String?) + ?: System.getenv("SONATYPE_USERNAME"), + ) + password.set( + (findProperty("mavenCentralPassword") as String?) + ?: System.getenv("SONATYPE_PASSWORD"), + ) } } } diff --git a/buildSrc/src/main/kotlin/hubspot.publish.gradle.kts b/buildSrc/src/main/kotlin/hubspot.publish.gradle.kts index 1ae8ee524..88f5be04c 100644 --- a/buildSrc/src/main/kotlin/hubspot.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/hubspot.publish.gradle.kts @@ -50,9 +50,12 @@ configure { } signing { - val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null } - val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null } - val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null } + val signingKeyId = (findProperty("signingInMemoryKeyId") as String?)?.ifBlank { null } + ?: System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null } + val signingKey = (findProperty("signingInMemoryKey") as String?)?.ifBlank { null } + ?: System.getenv("GPG_SIGNING_KEY")?.ifBlank { null } + val signingPassword = (findProperty("signingInMemoryKeyPassword") as String?)?.ifBlank { null } + ?: System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null } if (signingKey != null && signingPassword != null) { useInMemoryPgpKeys( signingKeyId,