release: Migrate artifacts publishing from legacy OSSRH to Central Portal (#12156)

This commit is contained in:
MV Shiva 2025-06-24 10:12:35 +05:30 committed by GitHub
parent 30d40a6179
commit f99b2aaef8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 7 deletions

View File

@ -102,7 +102,7 @@ For [Bazel](https://bazel.build), you can either
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
--------------

View File

@ -160,7 +160,7 @@ Tagging the Release
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

View File

@ -389,11 +389,11 @@ subprojects {
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 @@ subprojects {
}
}
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
}
}

View File

@ -59,7 +59,7 @@ if [ -z "$USERNAME" -o -z "$PASSWORD" ]; then
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 @@ XML="
</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"