Skip to content

Commit 490c780

Browse files
authored
Update SONATYPE publishing repository url (#47)
* Update SONATYPE publishing for new env vars This updates the SONATYPE publish to look for new ENV vars, SONATYPE_CENTRAL_USERNAME/SONATYPE_CENTRAL_PASSWORD which contains the changes for the new sonatype publishing. New envs are used to help with the transition. https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#plugins-tested-for-compatibility * Update SONATYPE publishing repository url This updates the SONATYPE url for the new staging API that serves as a shim. https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#getting-started-for-maven-api-like-plugins
1 parent a17fd14 commit 490c780

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
4646
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4747
GPG_SECRET_KEYS_ENC: ${{ secrets.GPG_SECRET_KEYS_ENC }}
48-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
49-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
48+
SONATYPE_CENTRAL_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
49+
SONATYPE_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ version = '1.0.0-SNAPSHOT'
3232
repositories {
3333
mavenCentral()
3434
maven {
35-
url "https://oss.sonatype.org/content/repositories/snapshots"
35+
url "https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots"
3636
}
3737
mavenLocal()
3838
}
@@ -56,8 +56,8 @@ sourceSets {
5656
}
5757

5858
nexusStaging {
59-
username = System.getenv('SONATYPE_USERNAME')
60-
password = System.getenv('SONATYPE_PASSWORD')
59+
username = System.getenv('SONATYPE_CENTRAL_USERNAME')
60+
password = System.getenv('SONATYPE_CENTRAL_PASSWORD')
6161
}
6262

6363

@@ -234,12 +234,12 @@ publishing {
234234

235235
repositories {
236236
maven {
237-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
238-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
237+
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
238+
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
239239
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
240240
credentials {
241-
username System.getenv('SONATYPE_USERNAME')
242-
password System.getenv('SONATYPE_PASSWORD')
241+
username System.getenv('SONATYPE_CENTRAL_USERNAME')
242+
password System.getenv('SONATYPE_CENTRAL_PASSWORD')
243243
}
244244
}
245245
}

ci/upload_to_maven.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo "$GPG_SECRET_KEYS_ENC" | base64 --decode > "$GPG_KEY_LOCATION"
88
export PROJECT_VERSION="$(./gradlew properties -q | grep "^version: " | awk '{print $2}')"
99
echo "\$PROJECT_VERSION: $PROJECT_VERSION" >&2
1010
# Upload only snapshots to Sonatype OSS so it can make its way to Maven Central
11-
# https://oss.sonatype.org/content/repositories/snapshots/io/tiledb/tiledb-cloud-java/
11+
# https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/io/tiledb/tiledb-cloud-java/
1212
./gradlew publishMavenJavaPublicationToMavenRepository
1313

1414
# Only non-snapshot can be pushed as Maven releases

0 commit comments

Comments
 (0)