Skip to content

Commit

Permalink
Reformatted xml payload
Browse files Browse the repository at this point in the history
  • Loading branch information
rickycpadilla committed May 24, 2024
1 parent 1bac400 commit 55e05df
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,33 @@ jobs:
run: |
repo_id=${{ steps.get_repo_id.outputs.repo_id }}
# Construct the XML payload
close_xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><promoteRequest><data><stagedRepositoryId>$repo_id</stagedRepositoryId></data></promoteRequest>"
close_xml="
<promoteRequest>
<data>
<stagedRepositoryId>$repo_id</stagedRepositoryId>
<description>$repo_id</description>
</data>
</promoteRequest>"
echo "Close XML: $close_xml"
# Send the XML payload using echo to avoid escaping issues
echo "$close_xml" | curl -v -u ${OSSRH_USERNAME}:${OSSRH_PASSWORD} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/close \
-H "Content-Type: application/xml" \
-d @-
curl -u ${OSSRH_USERNAME}:${OSSRH_PASSWORD} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/close \
-H "Content-Type: application/xml" \
-d "$close_xml"
# Wait for repository to close
sleep 60
promote_xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><promoteRequest><data><stagedRepositoryId>$repo_id</stagedRepositoryId></data></promoteRequest>"
promote_xml="
<promoteRequest>
<data>
<stagedRepositoryId>$repo_id</stagedRepositoryId>
<description>$repo_id</description>
</data>
</promoteRequest>"
echo "Promote XML: $promote_xml"
echo "$promote_xml" | curl -v -u ${OSSRH_USERNAME}:${OSSRH_PASSWORD} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/promote \
-H "Content-Type: application/xml" \
-d @-
curl -u ${OSSRH_USERNAME}:${OSSRH_PASSWORD} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/promote \
-H "Content-Type: application/xml" \
-d "$promote_xml"

0 comments on commit 55e05df

Please sign in to comment.