Skip to content

Commit

Permalink
fix: try to fix ridiculous way of publishing to sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
duruer committed Dec 4, 2024
1 parent 394f54e commit 2946b3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
25 changes: 13 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ plugins {
application
`maven-publish`
signing
id("io.deepmedia.tools.deployer") version "0.15.0"
}

group = "dev.parsek"
Expand Down Expand Up @@ -161,30 +162,30 @@ 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 {
create<MavenPublication>("shadow") {
project.extensions.configure<ShadowExtension> {
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()
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
rootProject.name = "Parsek"

pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}

0 comments on commit 2946b3d

Please sign in to comment.