From 775e79ce24a8d16987589f1725e21eff1f979edf Mon Sep 17 00:00:00 2001 From: "Artem Zinnatullin :slowpoke" Date: Fri, 16 Aug 2019 12:44:28 -0700 Subject: [PATCH] =?UTF-8?q?Apply=20gradle-nexus-staging-plugin=20to=20clos?= =?UTF-8?q?e=20and=20release=20repo=20on=20so=E2=80=A6=20(#21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 11 +++++++++++ ci | 3 +++ 2 files changed, 14 insertions(+) diff --git a/build.gradle b/build.gradle index c0032d5..61fd907 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,11 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + + // Uploads artifacts to oss.sonatype.org classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.3.0" + // "Closes" and "Releases" repository on oss.sonatype.org to finish release process. + classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -60,3 +64,10 @@ private def projectVersion() { return tag } + +apply plugin: 'io.codearte.nexus-staging' + +nexusStaging { + username = System.getenv("MAVEN_CENTRAL_USERNAME") + password = System.getenv("MAVEN_CENTRAL_PASSWORD") +} diff --git a/ci b/ci index 7a55bc3..4f57dae 100755 --- a/ci +++ b/ci @@ -54,4 +54,7 @@ else unset GPG_OWNERTRUST ./gradlew --stacktrace --info build publishToSonatype -Psigning.keyId="$GPG_KEY_ID" -Psigning.password="$GPG_PASSPHRASE" -Psigning.secretKeyRingFile="$HOME/.gnupg/secring.gpg" + + # Run closeAndReleaseRepository separately to avoid contention between publishing and closing. + ./gradlew --stacktrace --info closeAndReleaseRepository fi