diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f0f338..bb38bff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,8 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 - - name: Publish to Maven Local - run: ./gradlew publishToMavenLocal + - name: Publish to Maven Local (no signing) + run: ./gradlew publishToMavenLocal -PskipSigning=true # ── publish to Maven Central (on main only) ────────────────────────────────── publish: @@ -148,6 +148,25 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 + - name: Verify secrets are configured + run: | + missing=() + [ -z "$MAVEN_USER" ] && missing+=("MAVEN_CENTRAL_USERNAME") + [ -z "$MAVEN_PASS" ] && missing+=("MAVEN_CENTRAL_PASSWORD") + [ -z "$SIGNING_KEY" ] && missing+=("SIGNING_IN_MEMORY_KEY") + [ -z "$SIGNING_PASS" ] && missing+=("SIGNING_IN_MEMORY_KEY_PASSWORD") + if [ ${#missing[@]} -ne 0 ]; then + echo "❌ Missing secrets: ${missing[*]}" + echo "Add them in: GitHub repo → Settings → Secrets → Actions" + exit 1 + fi + echo "✅ All secrets present" + env: + MAVEN_USER: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_PASS: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_IN_MEMORY_KEY }} + SIGNING_PASS: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} + - name: Publish to Maven Central run: ./gradlew publishAllPublicationsToMavenCentralRepository env: diff --git a/formcraft-compose/build.gradle.kts b/formcraft-compose/build.gradle.kts index e86a07d..8628560 100644 --- a/formcraft-compose/build.gradle.kts +++ b/formcraft-compose/build.gradle.kts @@ -94,13 +94,15 @@ afterEvaluate { } } - signing { - val key = providers.gradleProperty("signingInMemoryKey").orNull - ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") - val pass = providers.gradleProperty("signingInMemoryKeyPassword").orNull - ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") - if (key != null && pass != null) { - useInMemoryPgpKeys(key, pass) + val signingKey = providers.gradleProperty("signingInMemoryKey").orNull + ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") + val signingPass = providers.gradleProperty("signingInMemoryKeyPassword").orNull + ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") + val skipSigning = providers.gradleProperty("skipSigning").isPresent + + if (!signingKey.isNullOrBlank() && !signingPass.isNullOrBlank() && !skipSigning) { + signing { + useInMemoryPgpKeys(signingKey, signingPass) sign(publishing.publications) } } diff --git a/formcraft-core/build.gradle.kts b/formcraft-core/build.gradle.kts index 520e8c0..5b7bd82 100644 --- a/formcraft-core/build.gradle.kts +++ b/formcraft-core/build.gradle.kts @@ -68,13 +68,15 @@ publishing { } } -signing { - val key = providers.gradleProperty("signingInMemoryKey").orNull - ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") - val pass = providers.gradleProperty("signingInMemoryKeyPassword").orNull - ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") - if (key != null && pass != null) { - useInMemoryPgpKeys(key, pass) +val signingKey = providers.gradleProperty("signingInMemoryKey").orNull + ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") +val signingPass = providers.gradleProperty("signingInMemoryKeyPassword").orNull + ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") +val skipSigning = providers.gradleProperty("skipSigning").isPresent + +if (!signingKey.isNullOrBlank() && !signingPass.isNullOrBlank() && !skipSigning) { + signing { + useInMemoryPgpKeys(signingKey, signingPass) sign(publishing.publications) } } diff --git a/formcraft-core/build/tmp/publishJvmPublicationToMavenLocal/module-maven-metadata.xml b/formcraft-core/build/tmp/publishJvmPublicationToMavenLocal/module-maven-metadata.xml index 83cce5b..4d2cad2 100644 --- a/formcraft-core/build/tmp/publishJvmPublicationToMavenLocal/module-maven-metadata.xml +++ b/formcraft-core/build/tmp/publishJvmPublicationToMavenLocal/module-maven-metadata.xml @@ -8,6 +8,6 @@ 0.1.0 - 20260407015704 + 20260407174447 diff --git a/formcraft-core/build/tmp/publishKotlinMultiplatformPublicationToMavenLocal/module-maven-metadata.xml b/formcraft-core/build/tmp/publishKotlinMultiplatformPublicationToMavenLocal/module-maven-metadata.xml index 279088b..a42af32 100644 --- a/formcraft-core/build/tmp/publishKotlinMultiplatformPublicationToMavenLocal/module-maven-metadata.xml +++ b/formcraft-core/build/tmp/publishKotlinMultiplatformPublicationToMavenLocal/module-maven-metadata.xml @@ -8,6 +8,6 @@ 0.1.0 - 20260407015704 + 20260407174447