Deploy the maven artifacts signed on Maven Central #13
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: Deploy the maven artifacts signed on Maven Central | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [created] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Maven Central Repository | |
| uses: actions/setup-java@v2 | |
| with: | |
| java-version: '21' | |
| distribution: 'adopt' | |
| server-id: central | |
| server-username: MAVEN_USERNAME # ${{ secrets.MAVEN_USERNAME }} | |
| server-password: MAVEN_PASSWORD # ${{ secrets.MAVEN_PASSWORD }} | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE # Don't work => ${{ secrets.GPG_PASSPHRASE }} as env var name should be defined | |
| - name: Check the gpg key | |
| run: | | |
| gpg --list-keys | |
| - name: Publish package | |
| run: | | |
| mvn -B -ntp deploy -DskipTests -Prelease | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |