Skip to content

Commit fbf551d

Browse files
committed
build.gradle: trying to auto-skip nexus and release directly to maven central
1 parent b139d5f commit fbf551d

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Publish package
2222
uses: gradle/gradle-build-action@v2
2323
with:
24-
arguments: publish
24+
arguments: publish publishToSonatype closeAndReleaseSonatypeStagingRepository
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ plugins {
1515
id 'signing'
1616
// the git-version plugin helps us to publish an auto version (taken from git tags)
1717
id 'com.palantir.git-version' version '0.13.0'
18+
// auto release to maven central (skip sonatype manual nexus release process)
19+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
1820
}
1921

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

108+
nexusPublishing {
109+
repositories {
110+
sonatype {
111+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
112+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
113+
username = System.getenv("OSSRH_USERNAME")
114+
password = System.getenv("OSSRH_PASSWORD")
115+
}
116+
}
117+
}
118+
106119
signing {
107120
def GPG_SIGNING_KEY = findProperty("signingKey") ?: System.getenv("GPG_SIGNING_KEY")
108121
def GPG_SIGNING_PASSPHRASE = findProperty("signingPassword") ?: System.getenv("GPG_SIGNING_PASSPHRASE")

0 commit comments

Comments
 (0)