From 7dc1bcf842fd530b90447ea2a84af151523705ab Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 19:23:47 +0100 Subject: [PATCH 1/6] Try to fix signing of publication artifacts --- .github/workflows/DEPLOY.yml | 7 ++--- build.gradle.kts | 51 ++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/DEPLOY.yml b/.github/workflows/DEPLOY.yml index 0801f48..b11b95d 100644 --- a/.github/workflows/DEPLOY.yml +++ b/.github/workflows/DEPLOY.yml @@ -18,9 +18,10 @@ on: env: CI: true FORCED_VERSION: ${{ inputs.forced_version || github.ref }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} - # Vanniktech maven-publish plugin reads these Gradle project properties for Central Portal auth + # Vanniktech maven-publish plugin reads these exact Gradle project property names for signing + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} + # Vanniktech maven-publish plugin reads these for Central Portal auth ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_KORGE_SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_KORGE_SONATYPE_PASSWORD }} JAVA_VERSION: 21 diff --git a/build.gradle.kts b/build.gradle.kts index f05e46a..43d1fde 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -248,24 +248,47 @@ open class DenoTestTask : AbstractTestTask() { } private fun Project.configureCentralPortalCompatibilityProps() { - // Keep previous env/property names working while using Vanniktech Central Portal publishing. - val legacySigningKey = System.getenv("ORG_GRADLE_PROJECT_signingKey") ?: findProperty("signing.signingKey")?.toString() - val legacySigningPassword = System.getenv("ORG_GRADLE_PROJECT_signingPassword") ?: findProperty("signing.password")?.toString() - val legacySonatypeUser = System.getenv("SONATYPE_USERNAME") ?: rootProject.findProperty("SONATYPE_USERNAME")?.toString() ?: findProperty("sonatypeUsername")?.toString() - val legacySonatypePassword = System.getenv("SONATYPE_PASSWORD") ?: rootProject.findProperty("SONATYPE_PASSWORD")?.toString() ?: findProperty("sonatypePassword")?.toString() - + // Map legacy env/property names to the exact names the Vanniktech plugin expects. + // Vanniktech reads: signingInMemoryKey, signingInMemoryKeyPassword, mavenCentralUsername, mavenCentralPassword val extras = extensions.extraProperties - if (!extras.has("signingInMemoryKey") && legacySigningKey != null) extras["signingInMemoryKey"] = legacySigningKey - if (!extras.has("signingInMemoryKeyPassword") && legacySigningPassword != null) extras["signingInMemoryKeyPassword"] = legacySigningPassword - if (!extras.has("mavenCentralUsername") && legacySonatypeUser != null) extras["mavenCentralUsername"] = legacySonatypeUser - if (!extras.has("mavenCentralPassword") && legacySonatypePassword != null) extras["mavenCentralPassword"] = legacySonatypePassword + + fun mapIfAbsent(targetKey: String, vararg sources: () -> String?) { + if (extras.has(targetKey) || findProperty(targetKey) != null) return + val value = sources.firstNotNullOfOrNull { it() } ?: return + extras[targetKey] = value + } + + mapIfAbsent("signingInMemoryKey", + { System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") }, + { System.getenv("ORG_GRADLE_PROJECT_signingKey") }, + { findProperty("signing.signingKey")?.toString() } + ) + mapIfAbsent("signingInMemoryKeyPassword", + { System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") }, + { System.getenv("ORG_GRADLE_PROJECT_signingPassword") }, + { findProperty("signing.password")?.toString() } + ) + mapIfAbsent("mavenCentralUsername", + { System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") }, + { System.getenv("SONATYPE_USERNAME") }, + { rootProject.findProperty("SONATYPE_USERNAME")?.toString() }, + { findProperty("sonatypeUsername")?.toString() } + ) + mapIfAbsent("mavenCentralPassword", + { System.getenv("ORG_GRADLE_PROJECT_mavenCentralPassword") }, + { System.getenv("SONATYPE_PASSWORD") }, + { rootProject.findProperty("SONATYPE_PASSWORD")?.toString() }, + { findProperty("sonatypePassword")?.toString() } + ) } private fun Project.hasSigningCredentials(): Boolean { - return findProperty("signingInMemoryKey") != null || + // Check both the native Vanniktech property name and legacy names + return System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") != null || + System.getenv("ORG_GRADLE_PROJECT_signingKey") != null || + findProperty("signingInMemoryKey") != null || findProperty("signing.secretKeyRingFile") != null || - System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") != null || - System.getenv("ORG_GRADLE_PROJECT_signingKey") != null + extensions.extraProperties.has("signingInMemoryKey") } subprojects { @@ -419,8 +442,8 @@ subprojects { // Publishing extensions.configure { - publishToMavenCentral() if (project.hasSigningCredentials()) { + publishToMavenCentral() signAllPublications() } From b969a5d0173605dc61bf4dc0d68e5c2916f0fa3b Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 20:29:07 +0100 Subject: [PATCH 2/6] Try to fix publishing macos targets --- .github/workflows/DEPLOY.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/DEPLOY.yml b/.github/workflows/DEPLOY.yml index b11b95d..2fe3920 100644 --- a/.github/workflows/DEPLOY.yml +++ b/.github/workflows/DEPLOY.yml @@ -38,10 +38,10 @@ jobs: - { os: ubuntu-latest, publishTask: "publishAndroidReleasePublicationToMavenCentral" } - { os: ubuntu-latest, publishTask: "publishKotlinMultiplatformPublicationToMavenCentral publishJvmPublicationToMavenCentral" } - { os: ubuntu-latest, publishTask: "publishJsPublicationToMavenCentral publishWasmJsPublicationToMavenCentral" } - - { os: macos-13, publishTask: "publishMacosX64PublicationToMavenCentral publishMacosArm64PublicationToMavenCentral" } - - { os: macos-13, publishTask: "publishTvosArm64PublicationToMavenCentral publishTvosSimulatorArm64PublicationToMavenCentral publishTvosX64PublicationToMavenCentral" } - - { os: macos-13, publishTask: "publishIosArm64PublicationToMavenCentral publishIosSimulatorArm64PublicationToMavenCentral publishIosX64PublicationToMavenCentral" } - - { os: macos-13, publishTask: "publishWatchosArm64PublicationToMavenCentral publishWatchosArm32PublicationToMavenCentral publishWatchosDeviceArm64PublicationToMavenCentral publishWatchosSimulatorArm64PublicationToMavenCentral" } + - { os: macos-latest, publishTask: "publishMacosX64PublicationToMavenCentral publishMacosArm64PublicationToMavenCentral" } + - { os: macos-latest, publishTask: "publishTvosArm64PublicationToMavenCentral publishTvosSimulatorArm64PublicationToMavenCentral publishTvosX64PublicationToMavenCentral" } + - { os: macos-latest, publishTask: "publishIosArm64PublicationToMavenCentral publishIosSimulatorArm64PublicationToMavenCentral publishIosX64PublicationToMavenCentral" } + - { os: macos-latest, publishTask: "publishWatchosArm64PublicationToMavenCentral publishWatchosArm32PublicationToMavenCentral publishWatchosDeviceArm64PublicationToMavenCentral publishWatchosSimulatorArm64PublicationToMavenCentral" } timeout-minutes: 300 runs-on: ${{ matrix.os }} steps: From f51e989c5f961b6e8d9351b6478ce48270e3555c Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 20:55:12 +0100 Subject: [PATCH 3/6] Add more robust signing credentials checks --- build.gradle.kts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 43d1fde..7b7da90 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -253,8 +253,11 @@ private fun Project.configureCentralPortalCompatibilityProps() { val extras = extensions.extraProperties fun mapIfAbsent(targetKey: String, vararg sources: () -> String?) { - if (extras.has(targetKey) || findProperty(targetKey) != null) return - val value = sources.firstNotNullOfOrNull { it() } ?: return + // Skip if already set to a non-blank value via extras or project properties + if (extras.has(targetKey) && extras[targetKey]?.toString().isNullOrBlank().not()) return + if (findProperty(targetKey)?.toString().isNullOrBlank().not()) return + // Find the first non-blank value among the sources + val value = sources.firstNotNullOfOrNull { it()?.takeIf { v -> v.isNotBlank() } } ?: return extras[targetKey] = value } @@ -283,12 +286,13 @@ private fun Project.configureCentralPortalCompatibilityProps() { } private fun Project.hasSigningCredentials(): Boolean { - // Check both the native Vanniktech property name and legacy names - return System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") != null || - System.getenv("ORG_GRADLE_PROJECT_signingKey") != null || - findProperty("signingInMemoryKey") != null || - findProperty("signing.secretKeyRingFile") != null || - extensions.extraProperties.has("signingInMemoryKey") + // A credential is only considered present when it resolves to a non-blank string. + fun String?.isPresent() = !isNullOrBlank() + return System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey").isPresent() || + System.getenv("ORG_GRADLE_PROJECT_signingKey").isPresent() || + findProperty("signingInMemoryKey")?.toString().isPresent() || + findProperty("signing.secretKeyRingFile")?.toString().isPresent() || + extensions.extraProperties.runCatching { get("signingInMemoryKey")?.toString() }.getOrNull().isPresent() } subprojects { From bd58a333b1836ec5d6f83825cb4bb152845c0fe1 Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 21:00:35 +0100 Subject: [PATCH 4/6] Fix dokka build --- .github/workflows/DOCS.yml | 2 +- gradle.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/DOCS.yml b/.github/workflows/DOCS.yml index 9602b73..a399bfc 100644 --- a/.github/workflows/DOCS.yml +++ b/.github/workflows/DOCS.yml @@ -24,7 +24,7 @@ concurrency: env: CI: true FORCED_VERSION: ${{ inputs.forced_version || github.ref }} - JAVA_VERSION: 17 + JAVA_VERSION: 21 JAVA_DISTRIBUTION: zulu jobs: diff --git a/gradle.properties b/gradle.properties index 890f988..240eccc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,5 @@ org.gradle.jvmargs=-Xmx3g +org.jetbrains.dokka.experimental.gradle.pluginMode=V1Enabled kotlin.daemon.jvmargs=-Xmx4g #org.gradle.jvmargs=-Xmx2g #org.gradle.jvmargs=-Xmx2800M -Dkotlin.daemon.jvm.options="-Xmx2800M" -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 From c805bcf5aebf46b562f2c7a1c48cb4deca93932b Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 21:33:03 +0100 Subject: [PATCH 5/6] Fix: migrate Dokka to V2 mode (required by Vanniktech 0.36.0) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 240eccc..ce6a405 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx3g -org.jetbrains.dokka.experimental.gradle.pluginMode=V1Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled kotlin.daemon.jvmargs=-Xmx4g #org.gradle.jvmargs=-Xmx2g #org.gradle.jvmargs=-Xmx2800M -Dkotlin.daemon.jvm.options="-Xmx2800M" -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 From acdcd29ea8eea9bc7d6bee2fd59604fd523e1d1e Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Thu, 26 Mar 2026 21:41:45 +0100 Subject: [PATCH 6/6] Fix DOCS.yml: use Dokka V2 task name dokkaGenerateHtml and correct output path --- .github/workflows/DOCS.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DOCS.yml b/.github/workflows/DOCS.yml index a399bfc..42f2582 100644 --- a/.github/workflows/DOCS.yml +++ b/.github/workflows/DOCS.yml @@ -37,6 +37,6 @@ jobs: - { name: Use Node.js 20.x, uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b, with: { node-version: 20.x } } # https://github.com/actions/setup-node/releases/tag/v4.0.3 - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0 - { name: Initialize Gradle, run: ./gradlew --no-configuration-cache } - - { name: Build Documentation, run: ./gradlew --no-configuration-cache dokkaHtmlMultiModule } - - { name: Upload artifact, uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa, with: { path: 'build/dokka/htmlMultiModule' } } # https://github.com/actions/upload-pages-artifact/releases/tag/v3.0.1 + - { name: Build Documentation, run: ./gradlew --no-configuration-cache dokkaGenerateHtml } + - { name: Upload artifact, uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa, with: { path: 'build/dokka/html' } } # https://github.com/actions/upload-pages-artifact/releases/tag/v3.0.1 - { name: Deploy 🚀 to GitHub Pages, id: deployment, uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e} # https://github.com/actions/deploy-pages/releases/tag/v4.0.5