Skip to content

Commit 19f594b

Browse files
authored
Fix task order when releasing to Nexus (#33)
1 parent de6d21d commit 19f594b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/build-and-publish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build-and-publish:
10-
name: Java Gradle Docker
10+
name: Java Gradle
1111
uses: bakdata/ci-templates/.github/workflows/[email protected]
1212
secrets:
1313
sonar-token: ${{ secrets.SONARCLOUD_TOKEN }}

build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,7 @@ if (!version.toString().endsWith("-SNAPSHOT")) {
9797

9898
val sonarqube by tasks
9999
sonarqube.enabled = false //FIXME requires Java 17
100+
101+
tasks.named("closeRepository") {
102+
mustRunAfter("publishToNexus")
103+
}

sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ class SonatypePlugin : Plugin<Project> {
8080
addParentPublishToNexusTasks()
8181

8282
disallowPublishTasks()
83+
84+
afterEvaluate {
85+
tasks.named("closeRepository") {
86+
mustRunAfter("publishToNexus")
87+
}
88+
}
8389
}
8490
}
8591

0 commit comments

Comments
 (0)