File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 5959 ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
6060 - name : Upload to Central Publisher Portal
6161 run : |
62- curl -X POST \
62+ echo "Uploading to Central Publisher Portal..."
63+ response=$(curl -s -w "%{http_code}" -X POST \
6364 "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.github.yoheimuta?publishing_type=automatic" \
64- -H "Authorization: Bearer ${{ secrets.OSSRH_TOKEN }}" \
65+ -u "${{ secrets.OSSRH_USERNAME }}: ${{ secrets.OSSRH_TOKEN }}" \
6566 -H "Content-Type: application/json" \
66- -d '{}'
67+ -d '{}')
68+
69+ http_code="${response: -3}"
70+ response_body="${response%???}"
71+
72+ echo "HTTP Status: $http_code"
73+ echo "Response: $response_body"
74+
75+ if [ "$http_code" -ne 200 ] && [ "$http_code" -ne 201 ] && [ "$http_code" -ne 204 ]; then
76+ echo "Upload failed with HTTP $http_code"
77+ echo "Response: $response_body"
78+ exit 1
79+ else
80+ echo "Upload successful!"
81+ fi
You can’t perform that action at this time.
0 commit comments