Skip to content

Commit 68cb21f

Browse files
committed
Migrate to Central Portal OSSRH Staging API
Closes gh-69
1 parent f760757 commit 68cb21f

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
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: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ buildscript {
22
repositories {
33
mavenCentral()
44
gradlePluginPortal()
5-
if (project.projectVersion.endsWith('-SNAPSHOT')) {
6-
maven {
7-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
5+
maven {
6+
name = 'Maven Central Portal Snapshots'
7+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
8+
9+
content {
10+
includeGroupAndSubgroups 'org.graceframework'
11+
}
12+
mavenContent {
13+
snapshotsOnly()
814
}
915
}
1016
}
@@ -38,9 +44,15 @@ apply plugin: "signing"
3844

3945
repositories {
4046
mavenCentral()
41-
if (project.projectVersion.endsWith('-SNAPSHOT')) {
42-
maven {
43-
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
47+
maven {
48+
name = 'Maven Central Portal Snapshots'
49+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
50+
51+
content {
52+
includeGroupAndSubgroups 'org.graceframework'
53+
}
54+
mavenContent {
55+
snapshotsOnly()
4456
}
4557
}
4658
}
@@ -195,16 +207,15 @@ publishing {
195207
}
196208

197209
nexusPublishing {
210+
packageGroup = 'org.graceframework.plugins'
198211
repositories {
199212
sonatype {
200-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
201-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
202-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
203-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
204-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
205-
username = ossUser
206-
password = ossPass
207-
stagingProfileId = ossStagingProfileId
213+
def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : ''
214+
def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : ''
215+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
216+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
217+
username = mavenUser
218+
password = mavenPass
208219
}
209220
}
210221
}

0 commit comments

Comments
 (0)