Skip to content

Commit

Permalink
build.gradle: trying to auto-skip nexus and release directly to maven…
Browse files Browse the repository at this point in the history
… central
  • Loading branch information
asafc committed Jan 27, 2022
1 parent b139d5f commit fbf551d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: publish
arguments: publish publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ plugins {
id 'signing'
// the git-version plugin helps us to publish an auto version (taken from git tags)
id 'com.palantir.git-version' version '0.13.0'
// auto release to maven central (skip sonatype manual nexus release process)
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

// sets the java package version automatically (looks at the git repo, latest tags, commit hashes, etc)
Expand Down Expand Up @@ -103,6 +105,17 @@ publishing {
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}

signing {
def GPG_SIGNING_KEY = findProperty("signingKey") ?: System.getenv("GPG_SIGNING_KEY")
def GPG_SIGNING_PASSPHRASE = findProperty("signingPassword") ?: System.getenv("GPG_SIGNING_PASSPHRASE")
Expand Down

0 comments on commit fbf551d

Please sign in to comment.