Skip to content

Commit 99a83a0

Browse files
therajanmauryaRajan Mauryaclaude
authored
fix(publish): drop conditional sign + remove coordinates( comment trap (#117)
The publish workflow's "Discover Modules" step does `grep 'coordinates(' build.gradle.kts` to extract artifact names. Both cmp-observe and cmp-observe-koin had comment blocks containing the literal token (e.g. "// Calling coordinates() here breaks..."). The grep matched the comment, sed failed to extract a name from a comment line, and the multi-line comment text became the ARTIFACT value — which broke $GITHUB_OUTPUT's key=value format with "Invalid format" on the next push. Aligning all 4 affected modules to the canonical pattern used by cmp-remote-config + cmp-share + cmp-product-tickets etc.: mavenPublishing { signAllPublications() pom { ... } } ## Changes per module | Module | Before | After | |---|---|---| | cmp-observe | comment block + `if (signingInMemoryKey.isPresent) signAllPublications()` | plain `signAllPublications()` | | cmp-observe-koin | comment block + conditional | plain `signAllPublications()` | | cmp-network-monitor | conditional (no comment trap) | plain `signAllPublications()` | | cmp-network-monitor-compose | conditional (no comment trap) | plain `signAllPublications()` | The `if (providers.gradleProperty("signingInMemoryKey").isPresent)` guard was a leftover from a transitional period. signAllPublications() is safe to call unconditionally — vanniktech's plugin no-ops at sign-time when in-memory key isn't present (logs a warning), so local `assemble` / `publishToMavenLocal` builds still work. Matches what cmp-remote-config and 21 other cmp-* modules already do. Post-fix sweep: 21/21 modules with mavenPublishing block use plain `signAllPublications()`. Zero comment-trap matches remain. Co-authored-by: Rajan Maurya <therajanmaurya@Rajans-MacBook-Pro.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 233ae90 commit 99a83a0

4 files changed

Lines changed: 4 additions & 30 deletions

File tree

cmp-network-monitor-compose/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ kotlin {
113113
// MAVEN CENTRAL PUBLISHING CONFIGURATION
114114
// ============================================================================
115115
mavenPublishing {
116-
// Sign only when credentials are present (Maven Central / CI). Skip for local dev builds.
117-
if (providers.gradleProperty("signingInMemoryKey").isPresent) {
118-
signAllPublications()
119-
}
116+
signAllPublications()
120117

121118
pom {
122119
name = "CMP Network Monitor Compose"

cmp-network-monitor/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ kotlin {
165165
// MAVEN CENTRAL PUBLISHING CONFIGURATION
166166
// ============================================================================
167167
mavenPublishing {
168-
// Sign only when credentials are present (Maven Central / CI). Skip for local dev builds.
169-
if (providers.gradleProperty("signingInMemoryKey").isPresent) {
170-
signAllPublications()
171-
}
168+
signAllPublications()
172169

173170
pom {
174171
name = "CMP Network Monitor"

cmp-observe-koin/build.gradle.kts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,7 @@ kotlin {
8989
}
9090

9191
mavenPublishing {
92-
// No explicit coordinates() — the vanniktech plugin auto-derives from
93-
// project.group / project.name / project.version. Calling coordinates()
94-
// here breaks the publish workflow, which pre-finalizes the version
95-
// property; a second assignment throws:
96-
// "The value for extension 'mavenPublishing' property 'version$plugin'
97-
// is final and cannot be changed any further."
98-
99-
// Sign only when credentials are present (Maven Central / CI). Skip for local dev builds.
100-
if (providers.gradleProperty("signingInMemoryKey").isPresent) {
101-
signAllPublications()
102-
}
92+
signAllPublications()
10393

10494
pom {
10595
name = "CMP Observe Koin"

cmp-observe/build.gradle.kts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,7 @@ kotlin {
167167
}
168168

169169
mavenPublishing {
170-
// No explicit coordinates() — the vanniktech plugin auto-derives from
171-
// project.group / project.name / project.version. Calling coordinates()
172-
// here breaks the publish workflow, which pre-finalizes the version
173-
// property (`-Pversion=X.Y.Z`); a second assignment throws:
174-
// "The value for extension 'mavenPublishing' property 'version$plugin'
175-
// is final and cannot be changed any further."
176-
177-
// Sign only when credentials are present (Maven Central / CI). Skip for local dev builds.
178-
if (providers.gradleProperty("signingInMemoryKey").isPresent) {
179-
signAllPublications()
180-
}
170+
signAllPublications()
181171

182172
pom {
183173
name = "CMP Observe"

0 commit comments

Comments
 (0)