diff --git a/build.gradle.kts b/build.gradle.kts index b4c3ee4..39813b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ buildscript { } plugins { - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" + id("io.github.gradle-nexus.publish-plugin") version "1.3.0" id("org.jetbrains.dokka") version "1.5.30" } diff --git a/scripts/publish-root.gradle b/scripts/publish-root.gradle index 2ab8b6f..bede1c6 100644 --- a/scripts/publish-root.gradle +++ b/scripts/publish-root.gradle @@ -2,8 +2,8 @@ ext["signing.keyId"] = '' ext["signing.password"] = '' ext["signing.key"] = '' -ext["ossrhUsername"] = '' -ext["ossrhPassword"] = '' +ext["centralUsername"] = '' +ext["centralPassword"] = '' ext["sonatypeStagingProfileId"] = '' File secretPropsFile = project.rootProject.file('local.properties') @@ -15,24 +15,26 @@ if (secretPropsFile.exists()) { p.each { name, value -> ext[name] = value } } else { // Use system environment variables - ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') - ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') + // For Central Portal, use token as password (username is your Sonatype account username) + ext["centralUsername"] = System.getenv('CENTRAL_USERNAME') ?: System.getenv('OSSRH_USERNAME') + ext["centralPassword"] = System.getenv('CENTRAL_PASSWORD') ?: System.getenv('OSSRH_PASSWORD') ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') ext["signing.password"] = System.getenv('SIGNING_PASSWORD') ext["signing.key"] = System.getenv('SIGNING_KEY') } -// Set up Sonatype repository +// Set up Central Portal repository nexusPublishing { repositories { sonatype { stagingProfileId = sonatypeStagingProfileId - username = ossrhUsername - password = ossrhPassword + username = centralUsername + password = centralPassword - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + // Central Portal endpoints + nexusUrl.set(uri("https://central.sonatype.com/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/content/repositories/snapshots/")) } } } \ No newline at end of file