diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index f714520..3207c71 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -7,7 +7,7 @@ on: jobs: build-and-publish: - name: Java Gradle Docker + name: Java Gradle uses: bakdata/ci-templates/.github/workflows/java-gradle-plugin.yaml@1.40.5 secrets: sonar-token: ${{ secrets.SONARCLOUD_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 3dea9b7..7754cce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -97,3 +97,7 @@ if (!version.toString().endsWith("-SNAPSHOT")) { val sonarqube by tasks sonarqube.enabled = false //FIXME requires Java 17 + +tasks.named("closeRepository") { + mustRunAfter("publishToNexus") +} diff --git a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt index bdb3661..27e663f 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -80,6 +80,12 @@ class SonatypePlugin : Plugin { addParentPublishToNexusTasks() disallowPublishTasks() + + afterEvaluate { + tasks.named("closeRepository") { + mustRunAfter("publishToNexus") + } + } } }