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 23
23
ORG_GRADLE_PROJECT_signingKeyId : ${{ secrets.SIGNING_KEY_ID }}
24
24
ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.SIGNING_PASSWORD }}
25
25
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 25
25
repositories {
26
26
mavenCentral()
27
27
maven {
28
- url ' https://oss .sonatype.org/content/repositories/ snapshots'
28
+ url ' https://central .sonatype.com/repository/maven- snapshots/ '
29
29
}
30
30
}
31
31
70
70
publishing {
71
71
repositories {
72
72
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/" )
75
75
if (version. toString(). endsWith(" SNAPSHOT" )) {
76
76
url = snapshotsRepoUrl
77
77
} else {
You can’t perform that action at this time.
0 commit comments