diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a4f49f0..0162b2c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: uses: gradle/actions/setup-gradle@v3 - name: publish release - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository + run: ./gradlew publishToSonatype closeAndReleaseStagingRepositories env: RELEASE_VERSION: ${{ github.event.inputs.version }} ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} diff --git a/benchmark/build.gradle.kts b/benchmark/build.gradle.kts index 7c31bdc3..7ea41eac 100644 --- a/benchmark/build.gradle.kts +++ b/benchmark/build.gradle.kts @@ -1,7 +1,9 @@ +import kotlinx.benchmark.gradle.JvmBenchmarkTarget + plugins { java kotlin("jvm") version libs.versions.kotlin - id("org.jetbrains.kotlinx.benchmark") version "0.4.10" + id("org.jetbrains.kotlinx.benchmark") version "0.4.11" kotlin("plugin.allopen") version libs.versions.kotlin kotlin("plugin.serialization") version libs.versions.kotlin } @@ -17,13 +19,16 @@ benchmark { } } targets { - register("main") + register("main") { + this as JvmBenchmarkTarget + jmhVersion = "1.37" + } } } dependencies { implementation("org.apache.commons:commons-lang3:3.14.0") - implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.10") + implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.11") val jacksonVersion = "2.17.0" implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion") diff --git a/build.gradle.kts b/build.gradle.kts index 3b9f9492..acd44abe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -69,30 +69,9 @@ tasks.named("javadocJar") { from(tasks.named("dokkaJavadoc")) } -// Configuration for publication on maven central -val signingKey: String? by project -val signingPassword: String? by project - -val publications: PublicationContainer = (extensions.getByName("publishing") as PublishingExtension).publications - -signing { - useGpgCmd() - if (signingKey != null && signingPassword != null) { - useInMemoryPgpKeys(signingKey, signingPassword) - } - if (Ci.isRelease) { - sign(publications) - } -} - -nexusPublishing { - this.repositories { - sonatype() - } -} publishing { publications { - register("mavenJava", MavenPublication::class) { + create("mavenJava") { from(components["java"]) pom { val projectUrl = "https://github.com/avro-kotlin/avro4k" @@ -130,9 +109,25 @@ publishing { } } -fun Project.publishing(action: PublishingExtension.() -> Unit) = configure(action) +nexusPublishing { + repositories { + sonatype() + } +} -fun Project.signing(configure: SigningExtension.() -> Unit): Unit = configure(configure) +signing { + if (Ci.isRelease) { + val signingKey: String? by project + val signingPassword: String? by project + + if (signingKey != null && signingPassword != null) { + useInMemoryPgpKeys(signingKey, signingPassword) + } else { + throw IllegalStateException("No signing key or password found") + } + sign(publishing.publications) + } +} object Ci { // this is the version used for building snapshots diff --git a/settings.gradle.kts b/settings.gradle.kts index f544d362..b73d99e2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -36,18 +36,18 @@ dependencyResolutionManagement { library("kotlinx-serialization-core", "org.jetbrains.kotlinx", "kotlinx-serialization-core").version(kotlinxSerialization) library("kotlinx-serialization-json", "org.jetbrains.kotlinx", "kotlinx-serialization-json").version(kotlinxSerialization) - val kotestVersion = "5.8.0" + val kotestVersion = "5.9.1" library("kotest-core", "io.kotest", "kotest-assertions-core").version(kotestVersion) library("kotest-json", "io.kotest", "kotest-assertions-json").version(kotestVersion) library("kotest-junit5", "io.kotest", "kotest-runner-junit5").version(kotestVersion) library("kotest-property", "io.kotest", "kotest-property").version(kotestVersion) - plugin("dokka", "org.jetbrains.dokka").version("1.9.10") + plugin("dokka", "org.jetbrains.dokka").version("1.9.20") plugin("kotest", "io.kotest").version("0.4.11") - plugin("github-versions", "com.github.ben-manes.versions").version("0.46.0") - plugin("nexus-publish", "io.github.gradle-nexus.publish-plugin").version("1.3.0") + plugin("github-versions", "com.github.ben-manes.versions").version("0.51.0") + plugin("nexus-publish", "io.github.gradle-nexus.publish-plugin").version("2.0.0") plugin("spotless", "com.diffplug.spotless").version("6.25.0") - plugin("kover", "org.jetbrains.kotlinx.kover").version("0.7.6") + plugin("kover", "org.jetbrains.kotlinx.kover").version("0.8.1") plugin("binary-compatibility-validator", "org.jetbrains.kotlinx.binary-compatibility-validator").version("0.14.0") } }