Skip to content

Commit 714613d

Browse files
Sundram SinghSundram Singh
authored andcommitted
publish maven action issue fixed
1 parent 2cff5a5 commit 714613d

5 files changed

Lines changed: 41 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ jobs:
123123
- name: Setup Android SDK
124124
uses: android-actions/setup-android@v3
125125

126-
- name: Publish to Maven Local
127-
run: ./gradlew publishToMavenLocal
126+
- name: Publish to Maven Local (no signing)
127+
run: ./gradlew publishToMavenLocal -PskipSigning=true
128128

129129
# ── publish to Maven Central (on main only) ──────────────────────────────────
130130
publish:
@@ -148,6 +148,25 @@ jobs:
148148
- name: Setup Android SDK
149149
uses: android-actions/setup-android@v3
150150

151+
- name: Verify secrets are configured
152+
run: |
153+
missing=()
154+
[ -z "$MAVEN_USER" ] && missing+=("MAVEN_CENTRAL_USERNAME")
155+
[ -z "$MAVEN_PASS" ] && missing+=("MAVEN_CENTRAL_PASSWORD")
156+
[ -z "$SIGNING_KEY" ] && missing+=("SIGNING_IN_MEMORY_KEY")
157+
[ -z "$SIGNING_PASS" ] && missing+=("SIGNING_IN_MEMORY_KEY_PASSWORD")
158+
if [ ${#missing[@]} -ne 0 ]; then
159+
echo "❌ Missing secrets: ${missing[*]}"
160+
echo "Add them in: GitHub repo → Settings → Secrets → Actions"
161+
exit 1
162+
fi
163+
echo "✅ All secrets present"
164+
env:
165+
MAVEN_USER: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
166+
MAVEN_PASS: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
167+
SIGNING_KEY: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
168+
SIGNING_PASS: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
169+
151170
- name: Publish to Maven Central
152171
run: ./gradlew publishAllPublicationsToMavenCentralRepository
153172
env:

formcraft-compose/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ afterEvaluate {
9494
}
9595
}
9696

97-
signing {
98-
val key = providers.gradleProperty("signingInMemoryKey").orNull
99-
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey")
100-
val pass = providers.gradleProperty("signingInMemoryKeyPassword").orNull
101-
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
102-
if (key != null && pass != null) {
103-
useInMemoryPgpKeys(key, pass)
97+
val signingKey = providers.gradleProperty("signingInMemoryKey").orNull
98+
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey")
99+
val signingPass = providers.gradleProperty("signingInMemoryKeyPassword").orNull
100+
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
101+
val skipSigning = providers.gradleProperty("skipSigning").isPresent
102+
103+
if (!signingKey.isNullOrBlank() && !signingPass.isNullOrBlank() && !skipSigning) {
104+
signing {
105+
useInMemoryPgpKeys(signingKey, signingPass)
104106
sign(publishing.publications)
105107
}
106108
}

formcraft-core/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ publishing {
6868
}
6969
}
7070

71-
signing {
72-
val key = providers.gradleProperty("signingInMemoryKey").orNull
73-
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey")
74-
val pass = providers.gradleProperty("signingInMemoryKeyPassword").orNull
75-
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
76-
if (key != null && pass != null) {
77-
useInMemoryPgpKeys(key, pass)
71+
val signingKey = providers.gradleProperty("signingInMemoryKey").orNull
72+
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey")
73+
val signingPass = providers.gradleProperty("signingInMemoryKeyPassword").orNull
74+
?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
75+
val skipSigning = providers.gradleProperty("skipSigning").isPresent
76+
77+
if (!signingKey.isNullOrBlank() && !signingPass.isNullOrBlank() && !skipSigning) {
78+
signing {
79+
useInMemoryPgpKeys(signingKey, signingPass)
7880
sign(publishing.publications)
7981
}
8082
}

formcraft-core/build/tmp/publishJvmPublicationToMavenLocal/module-maven-metadata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<versions>
99
<version>0.1.0</version>
1010
</versions>
11-
<lastUpdated>20260407015704</lastUpdated>
11+
<lastUpdated>20260407174447</lastUpdated>
1212
</versioning>
1313
</metadata>

formcraft-core/build/tmp/publishKotlinMultiplatformPublicationToMavenLocal/module-maven-metadata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<versions>
99
<version>0.1.0</version>
1010
</versions>
11-
<lastUpdated>20260407015704</lastUpdated>
11+
<lastUpdated>20260407174447</lastUpdated>
1212
</versioning>
1313
</metadata>

0 commit comments

Comments
 (0)