File tree Expand file tree Collapse file tree 3 files changed +26
-34
lines changed Expand file tree Collapse file tree 3 files changed +26
-34
lines changed Original file line number Diff line number Diff line change 2424 env :
2525 GITHUB_SECRET_PASSPHRASE : ${{ secrets.SECRETS_TAR_PASSPHRASE }}
2626 - name : Publish to MavenCentral
27- run : ./gradlew --info bundleReleaseAar publishReleasePublicationToSonatypeRepository closeAndReleaseRepository
27+ run : ./gradlew bundleReleaseAar publishToSonatype closeAndReleaseSonatypeStagingRepository
Original file line number Diff line number Diff line change 11// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
32buildscript {
43 ext {
54 sdkCompileVersion = 28
@@ -74,16 +73,15 @@ buildscript {
7473 classpath ' com.android.tools.build:gradle:4.1.0'
7574 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
7675
77- // Maven Central publishing
78- classpath ' com.vanniktech:gradle-maven-publish-plugin:0.13.0'
79- classpath ' org.jetbrains.dokka:dokka-gradle-plugin:1.4.10.2'
80- classpath ' io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0'
81-
8276 // NOTE: Do not place your application dependencies here; they belong
8377 // in the individual module build.gradle files
8478 }
8579}
8680
81+ plugins {
82+ id(" io.github.gradle-nexus.publish-plugin" ) version " 1.0.0"
83+ }
84+
8785allprojects {
8886 repositories {
8987 jcenter()
@@ -106,4 +104,23 @@ subprojects {
106104 tasks. withType(Javadoc ). all { enabled = false }
107105}
108106
109- apply plugin : ' io.codearte.nexus-staging'
107+ File ossrhProp = project. rootProject. file(' ossrh.properties' )
108+ if (ossrhProp. exists()) {
109+ Properties p = new Properties ()
110+ p. load(new FileInputStream (ossrhProp))
111+ p. each { name , value ->
112+ ext[name] = value
113+ }
114+
115+ group coreGroupId
116+ version coreVersion
117+
118+ nexusPublishing {
119+ repositories {
120+ sonatype {
121+ username = ossrhUsername
122+ password = ossrhPassword
123+ }
124+ }
125+ }
126+ }
Original file line number Diff line number Diff line change @@ -72,35 +72,10 @@ if (ossrhProp.exists()) {
7272 }
7373 }
7474 }
75- repositories {
76- // The repository to publish to, Sonatype/MavenCentral
77- maven {
78- // This is an arbitrary name, you may also use "mavencentral" or
79- // any other name that's descriptive for you
80- name = " sonatype"
81-
82- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
83- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
84- // You only need this if you want to publish snapshots, otherwise just set the URL
85- // to the release repo directly
86- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
87-
88- // The username and password we've fetched earlier
89- credentials {
90- username ossrhUsername
91- password ossrhPassword
92- }
93- }
94- }
9575 }
9676 signing {
9777 sign publishing. publications
9878 }
9979
100- nexusStaging {
101- packageGroup publishGroupId
102- stagingProfileId stagingProfileId
103- username ossrhUsername
104- password ossrhPassword
105- }
80+
10681}
You can’t perform that action at this time.
0 commit comments