Skip to content

Commit 665e03c

Browse files
committed
Migrate to Central Portal OSSRH Staging API
Closes gh-118
1 parent f25ef83 commit 665e03c

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +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 }}
76+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
77+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
7978
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
8079
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
8180
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}

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
}
@@ -31,14 +39,12 @@ apply plugin: "io.github.gradle-nexus.publish-plugin"
3139
nexusPublishing {
3240
repositories {
3341
sonatype {
34-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
35-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
36-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
37-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
38-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
39-
username = ossUser
40-
password = ossPass
41-
stagingProfileId = ossStagingProfileId
42+
def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : ''
43+
def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : ''
44+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
45+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
46+
username = mavenUser
47+
password = mavenPass
4248
}
4349
}
4450
}
@@ -61,7 +67,15 @@ subprojects { project->
6167
mavenCentral()
6268
if (project.projectVersion.endsWith('-SNAPSHOT')) {
6369
maven {
64-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
70+
name = 'Maven Central Portal Snapshots'
71+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
72+
73+
content {
74+
includeGroup 'org.graceframework'
75+
}
76+
mavenContent {
77+
snapshotsOnly()
78+
}
6579
}
6680
}
6781
}

0 commit comments

Comments
 (0)