From c32db9dd0628bfba0f3dc74491d16d8a202a5791 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Tue, 20 Feb 2024 17:07:33 +0100 Subject: [PATCH] Add back nexus publish Signed-off-by: Jendrik Johannes --- .github/workflows/release-artifacts.yml | 5 ++++- gradle/plugins/build.gradle.kts | 1 + .../kotlin/com.hedera.gradlebuild.root.gradle.kts | 14 +++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 619c1c954b..ecb8fcc240 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -98,4 +98,7 @@ jobs: run: ./gradlew assemble :sdk:javadoc --scan - name: Nexus Release - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + run: ./gradlew closeAndReleaseSonatypeStagingRepository --no-configuration-cache --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + + - name: Nexus Release (sdk-full) + run: ./gradlew -Pfull=true closeAndReleaseSonatypeStagingRepository --no-configuration-cache --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts index bbd0f29d6e..03893b5688 100644 --- a/gradle/plugins/build.gradle.kts +++ b/gradle/plugins/build.gradle.kts @@ -8,6 +8,7 @@ dependencies { implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.30.0") implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.7") implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4") + implementation("io.github.gradle-nexus:publish-plugin:1.3.0") implementation("net.ltgt.gradle:gradle-errorprone-plugin:3.1.0") implementation("org.gradlex:extra-java-module-info:1.8") implementation("org.gradlex:java-ecosystem-capabilities:1.5.1") diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.root.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.root.gradle.kts index 5ed0869b8f..98151dac4e 100644 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.root.gradle.kts +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.root.gradle.kts @@ -17,7 +17,7 @@ plugins { id("com.hedera.gradlebuild.repositories") id("com.autonomousapps.dependency-analysis") - // TODO id "io.github.gradle-nexus.publish-plugin" version "1.3.0" + id("io.github.gradle-nexus.publish-plugin") } val productVersion = layout.projectDirectory.file("version.txt").asFile.readText().trim() @@ -29,3 +29,15 @@ tasks.register("showVersion") { doLast { println(inputs.properties["version"]) } } + +nexusPublishing { + repositories { + sonatype { } + } +} + +tasks.named("closeSonatypeStagingRepository") { + // The publishing of all components to Maven Central (in this case only 'sdk') is + // automatically done before close (which is done before release). + dependsOn(":sdk:publishToSonatype") +}