Skip to content

Commit

Permalink
Force correct order of tasks in release
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Apr 18, 2022
1 parent c1646cd commit 24b0553
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,17 @@ tasks.withType<BaseStagingTask> {
tasks.getByName("getStagingProfile").enabled = ossrhConfigured

tasks.create("release") {
// Only close repository after release is published
val closeRepository by tasks
closeRepository.mustRunAfter(tasks.withType<PublishToMavenRepository>())
dependsOn(tasks.withType<PublishToMavenRepository>())

// Closes the sonatype repository and publishes to maven central
val closeAndReleaseRepository: Task by tasks
closeAndReleaseRepository.mustRunAfter(tasks.withType<PublishToMavenRepository>())
dependsOn(tasks.withType<PublishToMavenRepository>()) // uploads artifacts to sonatype
dependsOn(closeAndReleaseRepository) // does the maven central sync
dependsOn(build) // builds all jars for jenkins
dependsOn(closeAndReleaseRepository)

// Builds all jars for publications
dependsOn(build)
enabled = shouldPublish

doLast { // Only runs when shouldPublish = true
Expand Down

0 comments on commit 24b0553

Please sign in to comment.