Skip to content

Commit e8271a9

Browse files
author
Nikolay Kochetkov
committed
Sonatype publishing update (take 1)
1 parent 86dafed commit e8271a9

3 files changed

Lines changed: 17 additions & 22 deletions

File tree

appupdatewrapper/build.gradle

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,14 @@ def libId = 'appupdatewrapper'
9696
def libName = 'appupdatewrapper'
9797
def libDesc = 'A wrapper for Android `AppUpdateManager` to encapsulate update workflow.'
9898

99+
99100
afterEvaluate {
101+
102+
signing {
103+
useInMemoryPgpKeys(signingKey, signingPassword)
104+
sign publishing.publications
105+
}
106+
100107
publishing {
101108
publications {
102109
// Creates a Maven publication called "release".
@@ -131,20 +138,5 @@ afterEvaluate {
131138
}
132139
}
133140
}
134-
repositories {
135-
maven {
136-
name = "sonatype"
137-
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
138-
credentials {
139-
username ossrhUsername
140-
password ossrhPassword
141-
}
142-
}
143-
}
144-
}
145-
146-
signing {
147-
useInMemoryPgpKeys(signingKey, signingPassword)
148-
sign publishing.publications
149141
}
150142
}

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ buildscript {
2525
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2626
classpath 'org.ajoberstar.grgit:grgit-gradle:5.3.0'
2727
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
28-
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
28+
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
2929
}
3030
}
3131

@@ -70,13 +70,16 @@ tasks.register('displayVersion', Task) {
7070
}
7171
}
7272

73+
def sonatypeUsername = ext['sonatypeUsername']
74+
def sonatypePassword = ext['sonatypePassword']
75+
7376
nexusPublishing {
7477
repositories {
7578
sonatype {
76-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
77-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
78-
username = ossrhUsername
79-
password = ossrhPassword
79+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
80+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
81+
username=sonatypeUsername
82+
password=sonatypePassword
8083
}
8184
}
8285
}

gradle/maven-publish-config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (secretPropsFile.exists()) {
2929
def getFromEnv() {
3030
ext["signingKey"] = System.getenv('SIGNING_KEY')
3131
ext["signingPassword"] = System.getenv('SIGNING_PASSWORD')
32-
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
33-
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
32+
ext["sonatypeUsername"] = System.getenv('NEXUS_USERNAME')
33+
ext["sonatypePassword"] = System.getenv('NEXUS_PASSWORD')
3434
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
3535
}

0 commit comments

Comments
 (0)