Skip to content

Commit c516464

Browse files
committed
fix: Publishing fixes
1 parent 123634c commit c516464

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to Nexus
1+
name: Publish to Maven Central
22
on:
33
release:
44
types: [published]
@@ -41,9 +41,9 @@ jobs:
4141
env:
4242
signingKey: ${{secrets.SIGNING_KEY}}
4343
signingPassword: ${{secrets.SIGNING_PASSWORD}}
44-
OSS_USERNAME: ${{secrets.MAVEN_USERNAME}}
45-
OSS_PASSWORD: ${{secrets.MAVEN_SECRET}}
44+
MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}}
45+
MAVEN_SECRET: ${{secrets.MAVEN_SECRET}}
4646
run: |
47-
OSS_USERNAME=$OSS_USERNAME OSS_PASSWORD=$OSS_PASSWORD
47+
MAVEN_USERNAME=$MAVEN_USERNAME MAVEN_SECRET=$MAVEN_SECRET
4848
signingKey=$signingKey signingPassword=$signingPassword
49-
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository --info
49+
gradle publishMavenJavaPublicationToCentralRepository --info

build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ plugins {
66
id 'jacoco'
77
id 'signing'
88
id 'maven-publish'
9-
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
109
id 'com.github.hierynomus.license' version '0.16.1'
1110
id 'com.github.ben-manes.versions' version '0.51.0'
1211
}
@@ -106,6 +105,16 @@ test {
106105
}
107106

108107
publishing {
108+
repositories {
109+
maven {
110+
name = "central"
111+
url = "https://central.sonatype.com/api/v1/publisher/upload"
112+
credentials {
113+
username = System.getenv("MAVEN_USERNAME")
114+
password = System.getenv("MAVEN_SECRET")
115+
}
116+
}
117+
}
109118
publications {
110119
mavenJava(MavenPublication) {
111120
from components.java
@@ -167,15 +176,6 @@ publishing {
167176
}
168177
}
169178

170-
nexusPublishing {
171-
repositories {
172-
sonatype {
173-
username = System.getenv("MAVEN_USERNAME")
174-
password = System.getenv("MAVEN_SECRET")
175-
}
176-
}
177-
}
178-
179179
signing {
180180
def signingKey = findProperty("signingKey")
181181
def signingPassword = findProperty("signingPassword")

0 commit comments

Comments
 (0)