Skip to content

Commit 553a989

Browse files
committed
build: publish to Maven Central
1 parent 8013b22 commit 553a989

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

build.gradle.kts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
id("org.jetbrains.kotlinx.kover") version "0.7.0-Alpha"
66
kotlin("plugin.serialization") version "1.8.10"
77
`maven-publish`
8+
signing
89
}
910

1011
group = "nl.sanderdijkhuis"
@@ -19,6 +20,11 @@ dependencies {
1920
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
2021
}
2122

23+
java {
24+
withJavadocJar()
25+
withSourcesJar()
26+
}
27+
2228
kotlin {
2329
jvmToolchain(17)
2430
}
@@ -47,7 +53,36 @@ koverReport {
4753
publishing {
4854
publications {
4955
create<MavenPublication>("maven") {
56+
artifactId = "noise-kotlin"
5057
from(components["java"])
58+
pom {
59+
name.set("Noise for Kotlin")
60+
description.set("Noise protocols based on Diffie-Hellman key agreement")
61+
url.set("https://github.com/sander/noise-kotlin")
62+
licenses {
63+
license {
64+
name.set("MIT License")
65+
url.set("https://github.com/sander/noise-kotlin/blob/main/LICENSE.md")
66+
}
67+
}
68+
scm {
69+
connection.set("scm:git:git://github.com/sander/noise-kotlin.git")
70+
developerConnection.set("scm:git:ssh://github.com/sander/noise-kotlin.git")
71+
url.set("http://github.com/sander/noise-kotlin")
72+
}
73+
}
5174
}
5275
}
76+
repositories {
77+
maven {
78+
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
79+
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
80+
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
81+
credentials(PasswordCredentials::class.java)
82+
}
83+
}
84+
}
85+
86+
signing {
87+
sign(publishing.publications["maven"])
5388
}

0 commit comments

Comments
 (0)