Skip to content

Commit

Permalink
fix: think i finally actually fixed publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
brizzbuzz committed Sep 19, 2023
1 parent 8815257 commit 970c7bb
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
distribution: 'adopt'
java-version: '17'
- name: Publlish to Maven Central
- name: Publish to Maven Central
uses: burrunan/gradle-cache-action@v1
with:
gradle-version: wrapper
Expand Down
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
plugins {
// Child Plugins
kotlin("jvm") version "1.9.10" apply false
kotlin("multiplatform") version "1.9.10" apply false
kotlin("plugin.serialization") version "1.9.10" apply false
id("io.bkbn.sourdough.library.mpp") version "0.12.1" apply false
id("io.bkbn.sourdough.library.mpp") version "0.12.2-SNAPSHOT" apply false
id("io.kotest.multiplatform") version "5.7.2" apply false
id("io.gitlab.arturbosch.detekt") version "1.23.1" apply false
id("com.adarshr.test-logger") version "3.2.0" apply false

// Root Plugins
id("io.bkbn.sourdough.root") version "0.12.1"
id("io.bkbn.sourdough.root") version "0.12.2-SNAPSHOT"
id("com.github.jakemarsden.git-hooks") version "0.0.2"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
Expand Down
19 changes: 19 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ plugins {
id("signing")
}

// https://youtrack.jetbrains.com/issue/KT-46466
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}

sourdoughLibrary {
githubOrg.set("unredundant")
githubRepo.set("satisfaketion")
Expand Down Expand Up @@ -64,4 +70,17 @@ kotlin {
// val nativeMain by getting
// val nativeTest by getting
}

val publicationsFromMainHost =
listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
publishing {
publications {
matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
}
}
}
}
19 changes: 19 additions & 0 deletions generators/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ sourdoughLibrary {
developerEmail.set("[email protected]")
}

// https://youtrack.jetbrains.com/issue/KT-46466
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}

dependencies {
detektPlugins(group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version = "1.23.1")
}
Expand Down Expand Up @@ -76,4 +82,17 @@ kotlin {
// resources.srcDirs("resources")
// }
}

val publicationsFromMainHost =
listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
publishing {
publications {
matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Satisfaketion
project.version=0.8.1
project.version=0.8.3
# Kotlin
kotlin.code.style=official
kotlin.js.compiler=ir
Expand Down
19 changes: 19 additions & 0 deletions mutators/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ plugins {
id("signing")
}

// https://youtrack.jetbrains.com/issue/KT-46466
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}

sourdoughLibrary {
githubOrg.set("unredundant")
githubRepo.set("satisfaketion")
Expand Down Expand Up @@ -66,4 +72,17 @@ kotlin {
// val nativeMain by getting
// val nativeTest by getting
}

val publicationsFromMainHost =
listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
publishing {
publications {
matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
}
}
}
}

0 comments on commit 970c7bb

Please sign in to comment.