Skip to content

Commit fc3b197

Browse files
committed
automatically close and release nexus repositories
1 parent e530097 commit fc3b197

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
`java-library`
88
`maven-publish`
99
signing
10+
id("io.codearte.nexus-staging") version "0.30.0"
1011
kotlin("jvm") version "1.7.20-RC"
1112
id("org.jetbrains.dokka") version "1.8.10" // KDoc Documentation Builder
1213
id("com.github.breadmoirai.github-release") version "2.4.1"
@@ -53,6 +54,15 @@ val sourcesJar by tasks.registering(Jar::class) {
5354
from(sourceSets.main.get().allSource)
5455
}
5556

57+
nexusStaging {
58+
packageGroup = "com.cjcrafter"
59+
stagingProfileId = findProperty("OSSRH_ID").toString()
60+
username = findProperty("OSSRH_USERNAME").toString()
61+
password = findProperty("OSSRH_PASSWORD").toString()
62+
numberOfRetries = 30
63+
delayBetweenRetriesInMillis = 3000
64+
}
65+
5666
// Signing artifacts
5767
signing {
5868
isRequired = true
@@ -116,6 +126,11 @@ publishing {
116126
}
117127
}
118128

129+
// After publishing, the nexus plugin will automatically close and release
130+
tasks.named("publish") {
131+
finalizedBy("closeAndReleaseRepository")
132+
}
133+
119134
tasks.register<GithubReleaseTask>("createGithubRelease").configure {
120135
// https://github.com/BreadMoirai/github-release-gradle-plugin
121136
owner.set("CJCrafter")

0 commit comments

Comments
 (0)