Publish to Maven Central #5
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: | |
| push: | |
| tags: ["v*"] # Trigger on version tag pushes (adjust as needed) | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| # Import GPG signing key for Maven Central (from secrets) | |
| gpg-private-key: ${{ secrets.SIGNING_KEY_ID }} | |
| gpg-passphrase: ${{ secrets.SIGNING_PASSWORD }} | |
| - name: Publish to Sonatype Central | |
| env: | |
| # Pass Sonatype portal token credentials to Gradle | |
| ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| run: ./gradlew clean publishToSonatype closeAndReleaseSonatypeStagingRepository |