Skip to content

Commit

Permalink
sonatype config
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek committed Oct 12, 2021
1 parent 4c8890a commit 4fe90cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
FORCE_VERSION: ${{ github.event.inputs.forceVersion }}

- name: Publish to maven central
run: ./gradlew publishSonatypePublicationToMavenRepository
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
14 changes: 10 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id("pl.allegro.tech.build.axion-release") version "1.13.3"
id("com.adarshr.test-logger") version "3.0.0"
id("me.champeau.gradle.jmh") version "0.5.3"
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
}

repositories {
Expand Down Expand Up @@ -95,17 +96,22 @@ publishing {
}
repositories {
maven {
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}

nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}

System.getenv("GPG_KEY_ID")?.let {
signing {
useInMemoryPgpKeys(
Expand Down

0 comments on commit 4fe90cc

Please sign in to comment.