Version 0.2.11 - update publish plugin

This commit is contained in:
2025-05-03 11:10:00 +02:00
parent d671fbd64b
commit 5f53b98062
5 changed files with 64 additions and 56 deletions

View File

@@ -1,18 +1,24 @@
import com.vanniktech.maven.publish.SonatypeHost
plugins {
kotlin("multiplatform") version "2.1.20"
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.5.31"
id("org.jetbrains.dokka") version "2.0.0"
id("com.vanniktech.maven.publish") version "0.31.0"
}
group = "nl.astraeus"
version = "0.2.10"
version = "0.2.11"
repositories {
mavenCentral()
maven {
url = uri("https://gitea.astraeus.nl:8443/api/packages/rnentjes/maven")
}
maven {
name = "Sonatype Releases"
url = uri("https://central.sonatype.com/api/v1/publisher/deployments/download/")
}
}
kotlin {
@@ -46,25 +52,9 @@ kotlin {
}
}
extra["PUBLISH_GROUP_ID"] = group
extra["PUBLISH_VERSION"] = version
extra["PUBLISH_ARTIFACT_ID"] = name
// Stub secrets to let the project sync and build without the publication values set up
val signingKeyId: String? by project
val signingPassword: String? by project
val signingSecretKeyRingFile: String? by project
extra["signing.keyId"] = signingKeyId
extra["signing.password"] = signingPassword
extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
mavenLocal()
maven {
name = "gitea"
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
@@ -90,42 +80,43 @@ publishing {
}
}
}
}
// Configure all publications
publications.withType<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())
// Provide artifacts information requited by Maven Central
pom {
name.set("typed-byte-arrays")
description.set("Typed byte arrays")
url.set("https://gitea.astraeus.nl/rnentjes/typed-byte-arrays")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("rnentjes")
name.set("Rien Nentjes")
email.set("info@nentjes.com")
}
}
scm {
url.set("https://gitea.astraeus.nl/rnentjes/typed-byte-arrays")
}
}
}
tasks.withType<AbstractPublishToMaven> {
dependsOn(tasks.withType<Sign>())
}
signing {
sign(publishing.publications)
}
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.withType<Sign>())
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates(group.toString(), name, version.toString())
pom {
name = "typed-byte-arrays"
description = "Typed byte arrays"
inceptionYear = "2024"
url = "https://gitea.astraeus.nl/rnentjes/typed-byte-arrays"
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id = "rnentjes"
name = "Rien Nentjes"
email = "info@nentjes.com"
}
}
scm {
url = "https://gitea.astraeus.nl/rnentjes/typed-byte-arrays"
}
}
}