-
Notifications
You must be signed in to change notification settings - Fork 3.9k
release: Migrate artifacts publishing from legacy OSSRH to Central Portal #12156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
854dbda
release: revamping release to use Portal OSSRH Staging API
shivaspeaks 94d0a94
release: revamping release process to use Portal OSSRH Staging API
shivaspeaks 8164fdb
Merge branch 'master' of https://github.com/grpc/grpc-java into OSSRH…
shivaspeaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
|
||
| # 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" | ||
|
|
||
| # The manual API endpoint requires a Bearer token, which is the base64 of user:pass. | ||
| BEARER_TOKEN=$(echo -n "$USERPASS" | base64) | ||
|
|
||
| curl --fail-with-body -X POST \ | ||
| -H "Authorization: Bearer ${BEARER_TOKEN}" \ | ||
| -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" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the documentation said it is Bearer, but I'm suspicious it is actually Basic. You can see in the old API we passed
-uto curl, which does HTTP basic (because servers rarely request HTTP digest these days). The same for Gradle; it looks configured for Basic. The base64 scheme it talks about is actually Basic, except they replaced the Authorization header prefix with Bearer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found more on how we were using -u earlier, there it is explicitly shown the usage in the doc, on page 172. No mention of bearer in their the documentation. Why would they say in the new central portal! Thats unconventional by Sonatype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suspicious it was actually a typo or someone less familiar didn't realize the difference it was actually Basic. Bearer is very common, but for user:pass authentication should generally be Basic. They both start with B; someone might not realize the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah could be.
Even I found couple of typos at places in their migration documentations.