Skip to content

Commit d7a78c4

Browse files
committed
Migrate to Central Portal OSSRH Staging API
Closes gh-61
1 parent d9fe041 commit d7a78c4

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

.github/workflows/gradle.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ jobs:
5959
env:
6060
SECRING_FILE: ${{ secrets.SECRING_FILE }}
6161
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
62-
- name: Publish to Sonatype OSSRH
62+
- name: Publish to Maven Central Portal
6363
id: publish
6464
env:
65-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
66-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
67-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
68-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
65+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
66+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
6967
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
7068
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
7169
SECRING_FILE: ${{ secrets.SECRING_FILE }}

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,12 @@ jobs:
6969
env:
7070
SECRING_FILE: ${{ secrets.SECRING_FILE }}
7171
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
72-
- name: Publish to Sonatype OSSRH
72+
- name: Publish to Maven Central Portal
7373
id: publish
7474
if: steps.secring.outcome == 'success'
7575
env:
76-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
77-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
78-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
79-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
76+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
77+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
8078
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
8179
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
8280
SECRING_FILE: ${{ secrets.SECRING_FILE }}

build.gradle

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ buildscript {
44
gradlePluginPortal()
55
if (project.projectVersion.endsWith('-SNAPSHOT')) {
66
maven {
7-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
7+
name = 'Maven Central Portal Snapshots'
8+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
9+
10+
content {
11+
includeGroup 'org.graceframework'
12+
}
13+
mavenContent {
14+
snapshotsOnly()
15+
}
816
}
917
}
1018
}
@@ -39,7 +47,15 @@ repositories {
3947
mavenCentral()
4048
if (project.projectVersion.endsWith('-SNAPSHOT')) {
4149
maven {
42-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
50+
name = 'Maven Central Portal Snapshots'
51+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
52+
53+
content {
54+
includeGroup 'org.graceframework'
55+
}
56+
mavenContent {
57+
snapshotsOnly()
58+
}
4359
}
4460
}
4561
}
@@ -221,14 +237,12 @@ publishing {
221237
nexusPublishing {
222238
repositories {
223239
sonatype {
224-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
225-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
226-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
227-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
228-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
229-
username = ossUser
230-
password = ossPass
231-
stagingProfileId = ossStagingProfileId
240+
def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : ''
241+
def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : ''
242+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
243+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
244+
username = mavenUser
245+
password = mavenPass
232246
}
233247
}
234248
}

0 commit comments

Comments
 (0)