Skip to content

Commit efea3ea

Browse files
Update to use correct Central Publisher Portal API endpoints (/api/v1/*)
1 parent 3521caa commit efea3ea

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

.github/workflows/release-please.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ jobs:
6262

6363
- name: Debug - Test OSSRH connection
6464
run: |
65-
echo "Testing connection to OSSRH..."
65+
echo "Testing connection to Central Publisher Portal..."
6666
curl -u "${{ secrets.OSSRH_USERNAME }}:${{ secrets.OSSRH_TOKEN }}" \
6767
-H "Accept: application/json" \
68-
https://ossrh-staging-api.central.sonatype.com/service/local/user/profile \
69-
|| echo "Failed to connect to OSSRH"
68+
https://ossrh-staging-api.central.sonatype.com/api/v1/user \
69+
|| echo "Failed to connect to Central Publisher Portal"
7070
7171
- name: Deploy with Maven
7272
run: mvn --batch-mode clean deploy -X
@@ -117,11 +117,11 @@ jobs:
117117

118118
- name: Debug - Test OSSRH connection
119119
run: |
120-
echo "Testing connection to OSSRH..."
120+
echo "Testing connection to Central Publisher Portal..."
121121
curl -u "${{ secrets.OSSRH_USERNAME }}:${{ secrets.OSSRH_TOKEN }}" \
122122
-H "Accept: application/json" \
123-
https://ossrh-staging-api.central.sonatype.com/service/local/user/profile \
124-
|| echo "Failed to connect to OSSRH"
123+
https://ossrh-staging-api.central.sonatype.com/api/v1/user \
124+
|| echo "Failed to connect to Central Publisher Portal"
125125
126126
- name: Deploy with Maven
127127
run: mvn --batch-mode clean deploy -X

.github/workflows/test-osrh-token.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
steps:
1313
- name: Test OSSRH Token
1414
run: |
15-
echo "Testing OSSRH token validity..."
15+
echo "Testing Central Publisher Portal token validity..."
1616
17-
# Test basic authentication
17+
# Test basic authentication with Central Portal API
1818
echo "1. Testing basic authentication..."
1919
auth_response=$(curl -s -w "%{http_code}" -u "${{ secrets.OSSRH_USERNAME_2 }}:${{ secrets.OSSRH_TOKEN_2 }}" \
2020
-H "Accept: application/json" \
21-
https://ossrh-staging-api.central.sonatype.com/service/local/user/profile)
21+
https://ossrh-staging-api.central.sonatype.com/api/v1/user)
2222
2323
auth_http_code="${auth_response: -3}"
2424
auth_body="${auth_response%???}"
@@ -30,24 +30,24 @@ jobs:
3030
echo "User profile: $auth_body"
3131
elif [ "$auth_http_code" = "401" ]; then
3232
echo "❌ Token is invalid or expired (401 Unauthorized)"
33-
echo "Please regenerate your OSSRH token"
33+
echo "Please regenerate your Central Portal token"
3434
exit 1
3535
elif [ "$auth_http_code" = "403" ]; then
3636
echo "❌ Token is valid but lacks permissions (403 Forbidden)"
37-
echo "Check your OSSRH account permissions"
37+
echo "Check your Central Portal account permissions"
3838
exit 1
3939
else
4040
echo "❌ Unexpected response: HTTP $auth_http_code"
4141
echo "Response: $auth_body"
4242
exit 1
4343
fi
4444
45-
# Test staging access
45+
# Test staging access with Central Portal API
4646
echo ""
4747
echo "2. Testing staging repository access..."
4848
staging_response=$(curl -s -w "%{http_code}" -u "${{ secrets.OSSRH_USERNAME_2 }}:${{ secrets.OSSRH_TOKEN_2 }}" \
4949
-H "Accept: application/json" \
50-
https://ossrh-staging-api.central.sonatype.com/service/local/staging/profile_repositories)
50+
https://ossrh-staging-api.central.sonatype.com/api/v1/staging/profiles)
5151
5252
staging_http_code="${staging_response: -3}"
5353
staging_body="${staging_response%???}"
@@ -56,6 +56,7 @@ jobs:
5656
5757
if [ "$staging_http_code" = "200" ]; then
5858
echo "✅ Staging repository access successful"
59+
echo "Available profiles: $staging_body"
5960
else
6061
echo "❌ Staging repository access failed: HTTP $staging_http_code"
6162
echo "Response: $staging_body"

0 commit comments

Comments
 (0)