Skip to content

Commit

Permalink
unified publish task in root project
Browse files Browse the repository at this point in the history
  • Loading branch information
mfwgenerics committed Feb 16, 2023
1 parent 702eba4 commit c0b9613
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ jobs:
java-version: 19
distribution: temurin
- id: step-2
name: Publish to Maven Central
name: Publish Plugins and Libraries
env:
REPOSITORY_ID: ${{ needs.staging_repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_PASSWORD: ${{ secrets.GPG_PRIVATE_PASSWORD }}
run: ./gradlew publish
- id: step-3
name: Publish to Maven Central
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
run: ./gradlew :markout-plugin:publishPlugins
run: ./gradlew publish
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
tasks.register("check") {
dependsOn(gradle.includedBuilds.map { it.task(":check") })
}

tasks.register("publish") {
dependsOn(listOf(
gradle.includedBuild("markout-plugin"),
gradle.includedBuild("markout-docusaurus-plugin")
).map { it.task(":publishPlugins") })

dependsOn(listOf(
gradle.includedBuild("markout"),
gradle.includedBuild("markout-markdown"),
gradle.includedBuild("markout-docusaurus")
).map { it.task(":publish") })
}
11 changes: 2 additions & 9 deletions readme/src/main/kotlin/workflows/Release.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,14 @@ fun Markout.releaseYml() = workflow("release",
)

run(
name = "Publish to Maven Central",
name = "Publish Plugins and Libraries",
command = "./gradlew publish",
env = linkedMapOf(
"REPOSITORY_ID" to expr { staging.outputs.repository_id },
"SONATYPE_USERNAME" to expr { secrets.getValue("SONATYPE_USERNAME") },
"SONATYPE_PASSWORD" to expr { secrets.getValue("SONATYPE_PASSWORD") },
"GPG_PRIVATE_KEY" to expr { secrets.getValue("GPG_PRIVATE_KEY") },
"GPG_PRIVATE_PASSWORD" to expr { secrets.getValue("GPG_PRIVATE_PASSWORD") }
)
)

run(
name = "Publish to Maven Central",
command = "./gradlew :markout-plugin:publishPlugins",
env = linkedMapOf(
"GPG_PRIVATE_PASSWORD" to expr { secrets.getValue("GPG_PRIVATE_PASSWORD") },
"GRADLE_PUBLISH_KEY" to expr { secrets.getValue("GRADLE_PUBLISH_KEY") },
"GRADLE_PUBLISH_SECRET" to expr { secrets.getValue("GRADLE_PUBLISH_SECRET") }
)
Expand Down

0 comments on commit c0b9613

Please sign in to comment.