From ab70225bbf777ca32ecca58bffa6522cc81f6add Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Wed, 26 Jan 2022 18:18:15 +0300 Subject: [PATCH] build: Releases to Central (#11) * Add POM metadata * Add Javadoc jar * Disable signing for local build (when key is not provided) * Fix property in release.yml * Fix version of dependency in examples --- .github/workflows/release.yml | 1 - build.gradle.kts | 41 ++++++++++++++++++++++++-- examples/csv-example/build.gradle.kts | 2 +- examples/json-example/build.gradle.kts | 2 +- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d51f48b..24cf379 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,6 @@ jobs: arguments: | publishToSonatype closeSonatypeStagingRepository - -Preckon.stage=final -PsonatypeUsername=${{ secrets.SONATYPE_USER }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} - name: gradle snapshot from branch diff --git a/build.gradle.kts b/build.gradle.kts index 37ae4e4..8e2abda 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,10 @@ reckon { snapshotFromProp() } +java { + withJavadocJar() +} + application { mainClass.set("org.cqfn.save.adapter.RunnerKt") } @@ -38,14 +42,45 @@ publishing { } publications { create("maven") { - from(components["kotlin"]) + from(components["java"]) + pom { + name.set(project.name) + description.set(project.description ?: project.name) + url.set("https://github.com/analysis-dev/serialization-adapters") + licenses { + license { + name.set("MIT License") + url.set("http://www.opensource.org/licenses/mit-license.php") + distribution.set("repo") + } + } + developers { + developer { + id.set("petertrr") + name.set("Petr Trifanov") + email.set("peter.trifanov@mail.ru") + } + developer { + id.set("akuleshov7") + name.set("Andrey Kuleshov") + email.set("andrewkuleshov7@gmail.com") + } + } + scm { + url.set("https://github.com/cqfn/save") + connection.set("scm:git:git://github.com/cqfn/save.git") + } + } } } } signing { - useInMemoryPgpKeys(System.getenv("GPG_SEC"), System.getenv("GPG_PASSWORD")) - sign(*extensions.getByType().publications.toTypedArray()) + val gpgSecret = System.getenv("GPG_SEC") + if (gpgSecret != null) { + useInMemoryPgpKeys(gpgSecret, System.getenv("GPG_PASSWORD")) + sign(*extensions.getByType().publications.toTypedArray()) + } } nexusPublishing { diff --git a/examples/csv-example/build.gradle.kts b/examples/csv-example/build.gradle.kts index 463ac63..ca68c74 100644 --- a/examples/csv-example/build.gradle.kts +++ b/examples/csv-example/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } dependencies { - implementation("org.cqfn.save:save-adapters:0.1.0-SNAPSHOT") + implementation("org.cqfn.save:save-adapters:0.1.0") implementation("de.brudaswen.kotlinx.serialization:kotlinx-serialization-csv:2.0.0") } diff --git a/examples/json-example/build.gradle.kts b/examples/json-example/build.gradle.kts index 5af2160..b2a71c2 100644 --- a/examples/json-example/build.gradle.kts +++ b/examples/json-example/build.gradle.kts @@ -4,5 +4,5 @@ plugins { } dependencies { - implementation("org.cqfn.save:save-adapters:0.1.0-SNAPSHOT") + implementation("org.cqfn.save:save-adapters:0.1.0") }