Skip to content

Commit a1f6760

Browse files
committed
Migrate to Central Portal OSSRH Staging API
Closes gh-59
1 parent 6d3f528 commit a1f6760

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
@@ -62,13 +62,11 @@ jobs:
6262
env:
6363
SECRING_FILE: ${{ secrets.SECRING_FILE }}
6464
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
65-
- name: Publish to Sonatype OSSRH
65+
- name: Publish to Maven Central Portal
6666
id: publish
6767
env:
68-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
69-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
70-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
71-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
68+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
69+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
7270
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
7371
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
7472
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
}
@@ -36,7 +44,15 @@ allprojects {
3644
mavenCentral()
3745
if (project.projectVersion.endsWith('-SNAPSHOT')) {
3846
maven {
39-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
47+
name = 'Maven Central Portal Snapshots'
48+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
49+
50+
content {
51+
includeGroup 'org.graceframework'
52+
}
53+
mavenContent {
54+
snapshotsOnly()
55+
}
4056
}
4157
}
4258
}
@@ -245,14 +261,12 @@ project.afterEvaluate {
245261
nexusPublishing {
246262
repositories {
247263
sonatype {
248-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
249-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
250-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
251-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
252-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
253-
username = ossUser
254-
password = ossPass
255-
stagingProfileId = ossStagingProfileId
264+
def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : ''
265+
def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : ''
266+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
267+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
268+
username = mavenUser
269+
password = mavenPass
256270
}
257271
}
258272
}

0 commit comments

Comments
 (0)