Skip to content

Commit

Permalink
Migrate to io.github.gradle-nexus.publish-plugin (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgreze authored Aug 9, 2022
1 parent 9db56ca commit 44b2178
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
export SIGNING_SECRET_KEY_RING_FILE=secret-key.gpg
echo $SIGNING_SECRET_KEY_RING_CONTENT | base64 -di > $SIGNING_SECRET_KEY_RING_FILE
./gradlew assemble dokkaHtml
./gradlew --max-workers 1 publishMavenPublicationToSonatypeRepository closeAndReleaseRepository
./gradlew --max-workers 1 -Dorg.gradle.parallel=false \
publishMavenPublicationToSonatypeRepository \
closeAndReleaseSonatypeStagingRepository
- name: Publish Dokka
uses: netlify/actions/cli@master
with:
Expand Down
20 changes: 13 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("io.gitlab.arturbosch.detekt")
`maven-publish`
signing
id("io.codearte.nexus-staging")
id("io.github.gradle-nexus.publish-plugin")
}

val myGroup = "com.github.pgreze"
Expand Down Expand Up @@ -133,10 +133,16 @@ signing {
sign(publishing.publications)
}

// https://github.com/Codearte/gradle-nexus-staging-plugin
nexusStaging {
packageGroup = myGroup
stagingProfileId = propOrEnv("sonatype.staging.profile.id", "SONATYPE_STAGING_PROFILE_ID")
username = ossrhUsername
password = ossrhPassword
nexusPublishing {
packageGroup.set(myGroup)
repositories {
sonatype {
stagingProfileId.set(propOrEnv("sonatype.staging.profile.id", "SONATYPE_STAGING_PROFILE_ID"))
username.set(ossrhUsername)
password.set(ossrhPassword)
// Only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
3 changes: 2 additions & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ plugin.org.jlleitschuh.gradle.ktlint=10.3.0

plugin.io.gitlab.arturbosch.detekt=1.21.0

plugin.io.codearte.nexus-staging=0.30.0
# https://github.com/gradle-nexus/publish-plugin/
plugin.io.github.gradle-nexus.publish-plugin=1.1.0

version.kotlin=1.6.21
## # available=1.7.10
Expand Down

0 comments on commit 44b2178

Please sign in to comment.