Skip to content

Commit 775e79c

Browse files
artem-zinnatullinameliariely
authored andcommitted
Apply gradle-nexus-staging-plugin to close and release repo on so… (#21)
1 parent bacc629 commit 775e79c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ buildscript {
1111
dependencies {
1212
classpath 'com.android.tools.build:gradle:3.4.2'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
15+
// Uploads artifacts to oss.sonatype.org
1416
classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.3.0"
17+
// "Closes" and "Releases" repository on oss.sonatype.org to finish release process.
18+
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.0"
1519

1620
// NOTE: Do not place your application dependencies here; they belong
1721
// in the individual module build.gradle files
@@ -60,3 +64,10 @@ private def projectVersion() {
6064

6165
return tag
6266
}
67+
68+
apply plugin: 'io.codearte.nexus-staging'
69+
70+
nexusStaging {
71+
username = System.getenv("MAVEN_CENTRAL_USERNAME")
72+
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
73+
}

ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,7 @@ else
5454
unset GPG_OWNERTRUST
5555

5656
./gradlew --stacktrace --info build publishToSonatype -Psigning.keyId="$GPG_KEY_ID" -Psigning.password="$GPG_PASSPHRASE" -Psigning.secretKeyRingFile="$HOME/.gnupg/secring.gpg"
57+
58+
# Run closeAndReleaseRepository separately to avoid contention between publishing and closing.
59+
./gradlew --stacktrace --info closeAndReleaseRepository
5760
fi

0 commit comments

Comments
 (0)