Version 3.1.0 #7
Workflow file for this run
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
| name: publish release version explicitly | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # pin@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| - name: Build with Gradle | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| run: ./gradlew build publish -Prelease=true | |
| - name: Upload staged artifacts to Central Sonatype | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| run: | | |
| SONATYPE_TOKEN=$(printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64) | |
| PUBLISH_NAMESPACE="com.newrelic.opentracing" | |
| echo "Uploading artifacts from OSSRH-Staging to Central Sonatype..." | |
| RESPONSE=$(curl -s -w "%{http_code}" -o response_body.txt -X POST \ | |
| -H "Authorization: Bearer $SONATYPE_TOKEN" \ | |
| "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$PUBLISH_NAMESPACE?publishing_type=user_managed") | |
| if [ "$RESPONSE" -ne 200 ]; then | |
| echo "Failed to upload artifacts to Central Sonatype. Response code: $RESPONSE. Response body: " | |
| cat response_body.txt | |
| echo "Visit https://central.sonatype.com/publishing/deployments for more information." | |
| exit 1 | |
| else | |
| echo "Artifacts were uploaded successfully to Central Sonatype." | |
| echo "Visit https://central.sonatype.com/publishing/deployments to view your artifacts." | |
| fi |