v1.0.0 #8
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 to Maven Central | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Publish to Central Portal staging | |
| run: ./gradlew publish | |
| env: | |
| CENTRAL_PORTAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_TOKEN_USERNAME }} | |
| CENTRAL_PORTAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN_PASSWORD }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| - name: Finalize deployment on Central Portal | |
| run: | | |
| # Encode token as base64 for Bearer auth | |
| TOKEN=$(echo -n "${{ secrets.CENTRAL_PORTAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_PORTAL_TOKEN_PASSWORD }}" | base64) | |
| # Tell Central Portal to publish the staged deployment | |
| HTTP_CODE=$(curl -sS -o /tmp/finalize_body -w "%{http_code}" -X POST \ | |
| "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/com.lettr?publishing_type=automatic" \ | |
| -H "Authorization: Bearer $TOKEN") | |
| echo "HTTP status: $HTTP_CODE" | |
| echo "Response body:" | |
| cat /tmp/finalize_body | |
| echo | |
| [ "$HTTP_CODE" -lt 400 ] |