Skip to content

Commit d82fb82

Browse files
committed
ci: use new plugin for maven central
1 parent e6ed075 commit d82fb82

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
- name: Build with Gradle
4646
uses: gradle/gradle-build-action@main
4747
with:
48-
arguments: build publishAllPublicationsToSonatypeRepository closeAndReleaseRepository publishAllPublicationsToGithubRepository --scan
48+
arguments: build publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository publishAllPublicationsToGithubRepository --scan
4949

build.gradle.kts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins {
1818
kotlin("plugin.serialization") version "1.8.0"
1919

2020
id("com.android.library") version "7.4.0"
21-
id("io.codearte.nexus-staging") version "0.30.0"
21+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
2222
id("com.dorongold.task-tree") version "2.1.1"
2323
id("com.codingfeline.buildkonfig") version "0.13.3"
2424
id("dev.zxilly.gradle.keeper") version "0.0.5"
@@ -176,23 +176,22 @@ android {
176176

177177
val mavenCentralUser = secret.get("maven.user")
178178
val mavenCentralPassword = secret.get("maven.password")
179-
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
180-
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
181-
182-
val mavenCentralReleaseUrl =
183-
if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
184179

185180
val githubUser = secret.get("github.user")
186181
val githubToken = secret.get("github.token")
187182

188183
val githubPackageRegistryUrl = uri("https://maven.pkg.github.com/ZNotify/kt-sdk")
189184

190-
nexusStaging {
191-
serverUrl = "https://s01.oss.sonatype.org/service/local/"
192-
username = mavenCentralUser
193-
password = mavenCentralPassword
194-
packageGroup = "dev.zxilly"
195-
stagingProfileId = "95214448af0738"
185+
nexusPublishing {
186+
repositories {
187+
sonatype {
188+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
189+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
190+
username.set(mavenCentralUser)
191+
password.set(mavenCentralPassword)
192+
packageGroup.set("dev.zxilly")
193+
}
194+
}
196195
}
197196

198197
val javadocJar by tasks.registering(Jar::class) {
@@ -201,14 +200,6 @@ val javadocJar by tasks.registering(Jar::class) {
201200

202201
publishing {
203202
repositories {
204-
maven {
205-
name = "sonatype"
206-
url = mavenCentralReleaseUrl
207-
credentials {
208-
username = mavenCentralUser
209-
password = mavenCentralPassword
210-
}
211-
}
212203
maven {
213204
name = "github"
214205
url = githubPackageRegistryUrl

0 commit comments

Comments
 (0)