fix: switch to Central Portal publishing plugin #2
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*' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: temurin | |
| cache: maven | |
| server-id: central | |
| server-username: CENTRAL_USERNAME | |
| server-password: CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| mvn versions:set -DnewVersion=$VERSION --batch-mode --no-transfer-progress | |
| - name: Build and test | |
| run: mvn verify --batch-mode --no-transfer-progress | |
| - name: Deploy to Maven Central | |
| run: mvn deploy -Prelease --batch-mode --no-transfer-progress | |
| env: | |
| CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true |