diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index f9cde58..028e8b1 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -308,6 +308,9 @@ jobs: MAVEN_REPOSITORY_URL: ${{ secrets.MAVEN_REPOSITORY_URL }} MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} run: | chmod +x ./gradlew ./gradlew clean build diff --git a/src/kotlin/build.gradle.kts b/src/kotlin/build.gradle.kts index 55dde03..d3cd3fc 100644 --- a/src/kotlin/build.gradle.kts +++ b/src/kotlin/build.gradle.kts @@ -2,6 +2,7 @@ plugins { kotlin("jvm") version "2.1.10" jacoco `maven-publish` + signing } group = "com.cyascott" @@ -45,6 +46,11 @@ kotlin { jvmToolchain(17) } +java { + withSourcesJar() + withJavadocJar() +} + publishing { publications { create("mavenJava") { @@ -52,6 +58,32 @@ publishing { groupId = project.group.toString() artifactId = "poly-bus" version = project.version.toString() + + pom { + name.set("PolyBus") + description.set("A polyglot messaging framework for building interoperable applications across multiple programming languages.") + url.set("https://github.com/CyAScott/poly-bus") + + licenses { + license { + name.set("MIT License") + url.set("https://opensource.org/license/mit") + } + } + + developers { + developer { + id.set("cyascott") + name.set("Cy Scott") + } + } + + scm { + connection.set("scm:git:git://github.com/CyAScott/poly-bus.git") + developerConnection.set("scm:git:ssh://git@github.com/CyAScott/poly-bus.git") + url.set("https://github.com/CyAScott/poly-bus") + } + } } } @@ -74,3 +106,21 @@ publishing { } } } + +signing { + val signingKeyId = (findProperty("signingInMemoryKeyId") as String?) + ?: System.getenv("SIGNING_KEY_ID") + val signingKey = (findProperty("signingInMemoryKey") as String?) + ?: System.getenv("SIGNING_KEY") + val signingPassword = (findProperty("signingInMemoryKeyPassword") as String?) + ?: System.getenv("SIGNING_PASSWORD") + + if (!signingKey.isNullOrBlank()) { + if (!signingKeyId.isNullOrBlank()) { + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) + } else { + useInMemoryPgpKeys(signingKey, signingPassword) + } + sign(publishing.publications) + } +}