88 runs-on : ubuntu-latest
99 steps :
1010 - name : Checkout code
11- uses : actions/checkout@v3
11+ uses : actions/checkout@v4
1212 with :
1313 ref : master
1414 fetch-depth : 0
1717 git config user.name "Zonky Bot"
1818 git config user.email "[email protected] " 1919 - name : Set up JDK
20- uses : actions/setup-java@v3
20+ uses : actions/setup-java@v4
2121 with :
2222 distribution : ' zulu'
2323 java-version : 8
4848 -Prelease.useAutomaticVersion=true \
4949 -Prelease.releaseVersion=$RELEASE_VERSION \
5050 -Possrh.username=$MAVEN_USER \
51- -Possrh.password=$MAVEN_PASS
51+ -Possrh.password=$MAVEN_PASS
52+ - name : Upload staged artifacts to Central Sonatype
53+ env :
54+ SONATYPE_USERNAME : ${{ secrets.MAVEN_USER }}
55+ SONATYPE_PASSWORD : ${{ secrets.MAVEN_PASS }}
56+ run : |
57+ SONATYPE_TOKEN=$(printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64)
58+ PUBLISH_NAMESPACE="io.zonky"
59+ echo "Uploading artifacts from OSSRH-Staging to Central Sonatype..."
60+ RESPONSE=$(curl -s -w "%{http_code}" -o response_body.txt -X POST \
61+ -H "Authorization: Bearer $SONATYPE_TOKEN" \
62+ "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$PUBLISH_NAMESPACE?publishing_type=user_managed")
63+ if [ "$RESPONSE" -ne 200 ]; then
64+ echo "Failed to upload artifacts to Central Sonatype. Response code: $RESPONSE. Response body: "
65+ cat response_body.txt
66+ echo "Visit https://central.sonatype.com/publishing/deployments for more information."
67+ exit 1
68+ else
69+ echo "Artifacts were uploaded successfully to Central Sonatype."
70+ echo "Visit https://central.sonatype.com/publishing/deployments to view your artifacts."
71+ fi
0 commit comments