File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 2323 ORG_GRADLE_PROJECT_signingKeyId : ${{ secrets.SIGNING_KEY_ID }}
2424 ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.SIGNING_PASSWORD }}
2525 run : ./gradlew build publish -Prelease=true
26+
27+ - name : Upload staged artifacts to Central Sonatype
28+ env :
29+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
30+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
31+ run : |
32+ SONATYPE_TOKEN=$(printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64)
33+ PUBLISH_NAMESPACE="com.newrelic.opentracing"
34+ echo "Uploading artifacts from OSSRH-Staging to Central Sonatype..."
35+ RESPONSE=$(curl -s -w "%{http_code}" -o response_body.txt -X POST \
36+ -H "Authorization: Bearer $SONATYPE_TOKEN" \
37+ "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$PUBLISH_NAMESPACE?publishing_type=user_managed")
38+ if [ "$RESPONSE" -ne 200 ]; then
39+ echo "Failed to upload artifacts to Central Sonatype. Response code: $RESPONSE. Response body: "
40+ cat response_body.txt
41+ echo "Visit https://central.sonatype.com/publishing/deployments for more information."
42+ exit 1
43+ else
44+ echo "Artifacts were uploaded successfully to Central Sonatype."
45+ echo "Visit https://central.sonatype.com/publishing/deployments to view your artifacts."
46+ fi
Original file line number Diff line number Diff line change 2525repositories {
2626 mavenCentral()
2727 maven {
28- url ' https://oss .sonatype.org/content/repositories/ snapshots'
28+ url ' https://central .sonatype.com/repository/maven- snapshots/ '
2929 }
3030}
3131
7070publishing {
7171 repositories {
7272 maven {
73- def releasesRepoUrl = uri(" https://oss. sonatype.org /service/local/staging/deploy/maven2/" )
74- def snapshotsRepoUrl = uri(" https://oss .sonatype.org/content/repositories/ snapshots/" )
73+ def releasesRepoUrl = uri(" https://ossrh-staging-api.central. sonatype.com /service/local/staging/deploy/maven2/" )
74+ def snapshotsRepoUrl = uri(" https://central .sonatype.com/repository/maven- snapshots/" )
7575 if (version. toString(). endsWith(" SNAPSHOT" )) {
7676 url = snapshotsRepoUrl
7777 } else {
You can’t perform that action at this time.
0 commit comments