From 2946b3dd63234a04bb3a8c525c0757663098df29 Mon Sep 17 00:00:00 2001 From: kahverengi Date: Wed, 4 Dec 2024 21:15:52 +0300 Subject: [PATCH] fix: try to fix ridiculous way of publishing to sonatype --- build.gradle.kts | 25 +++++++++++++------------ settings.gradle.kts | 7 +++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7cfaadb..9fbc317 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,7 @@ plugins { application `maven-publish` signing + id("io.deepmedia.tools.deployer") version "0.15.0" } group = "dev.parsek" @@ -161,17 +162,6 @@ publishing { } } - maven { - name = "sonatype" - val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") - val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/") - url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl - - credentials { - username = System.getenv("OSSRH_USERNAME") - password = System.getenv("OSSRH_PASSWORD") - } - } } publications { @@ -179,12 +169,23 @@ publishing { project.extensions.configure { artifactId = "core" component(this@create) - } } } } +deployer { + centralPortalSpec { + // Take these credentials from the Generate User Token page at https://central.sonatype.com/account + auth.user.set(secret(System.getenv("OSSRH_USERNAME"))) + auth.password.set(secret(System.getenv("OSSRH_PASSWORD"))) + + // Signing is required + signing.key.set(secret(String(Base64.getDecoder().decode(System.getenv("GPG_PRIVATE_KEY").replace("\n", ""))))) + signing.password.set(secret(System.getenv("GPG_PASSPHRASE"))) + } +} + java { withJavadocJar() withSourcesJar() diff --git a/settings.gradle.kts b/settings.gradle.kts index 4b869b7..66386bd 100755 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,8 @@ rootProject.name = "Parsek" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} \ No newline at end of file