release: Migrate artifacts publishing from legacy OSSRH to Central Portal (#12156)
diff --git a/README.md b/README.md
index 012eab4..a925d15 100644
--- a/README.md
+++ b/README.md
@@ -102,7 +102,7 @@
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.73.0
Development snapshots are available in [Sonatypes's snapshot
-repository](https://oss.sonatype.org/content/repositories/snapshots/).
+repository](https://central.sonatype.com/repository/maven-snapshots/).
Generated Code
--------------
diff --git a/RELEASING.md b/RELEASING.md
index 120b0ea..c57829b 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -160,7 +160,7 @@
repository can then be `released`, which will begin the process of pushing
the new artifacts to Maven Central (the staging repository will be destroyed
in the process). You can see the complete process for releasing to Maven
- Central on the [OSSRH site](https://central.sonatype.org/pages/releasing-the-deployment.html).
+ Central on the [OSSRH site](https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#deploying).
10. We have containers for each release to detect compatibility regressions with
old releases. Generate one for the new release by following the [GCR image
diff --git a/build.gradle b/build.gradle
index 089c786..afea703 100644
--- a/build.gradle
+++ b/build.gradle
@@ -389,11 +389,11 @@
url = new File(rootProject.repositoryDir).toURI()
} else {
String stagingUrl
+ String baseUrl = "https://ossrh-staging-api.central.sonatype.com/service/local"
if (rootProject.hasProperty('repositoryId')) {
- stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' +
- rootProject.repositoryId
+ stagingUrl = "${baseUrl}/staging/deployByRepositoryId/" + rootProject.repositoryId
} else {
- stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
+ stagingUrl = "${baseUrl}/staging/deploy/maven2/"
}
credentials {
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) {
@@ -402,7 +402,7 @@
}
}
def releaseUrl = stagingUrl
- def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
+ def snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
}
}
diff --git a/buildscripts/sonatype-upload.sh b/buildscripts/sonatype-upload.sh
index 1663714..4baa4e4 100755
--- a/buildscripts/sonatype-upload.sh
+++ b/buildscripts/sonatype-upload.sh
@@ -59,7 +59,7 @@
exit 1
fi
-STAGING_URL="https://oss.sonatype.org/service/local/staging"
+STAGING_URL="https://ossrh-staging-api.central.sonatype.com/service/local/staging"
# We go through the effort of using deloyByRepositoryId/ because it is
# _substantially_ faster to upload files than deploy/maven2/. When using
@@ -108,3 +108,18 @@
</promoteRequest>"
curl --fail-with-body -X POST -d "$XML" -u "$USERPASS" -H "Content-Type: application/xml" \
"$STAGING_URL/profiles/$PROFILE_ID/finish"
+
+# TODO (okshiva): After 2-3 releases make it automatic.
+# After closing the repository on the staging API, we must manually trigger
+# its upload to the main Central Publisher Portal. We set publishing_type=automatic
+# to have it release automatically upon passing validation.
+# echo "Triggering release of repository ${REPOID} to the Central Portal"
+
+# MANUAL_API_URL="https://ossrh-staging-api.central.sonatype.com/service/local/manual"
+
+#curl --fail-with-body -X POST \
+# -H "Authorization: Bearer ${USERPASS}" \
+# -H "Content-Type: application/json" \
+# "${MANUAL_API_URL}/upload/repository/${REPOID}?publishing_type=automatic"
+
+# echo "Release triggered. Monitor progress at https://central.sonatype.com/publishing/deployments"