Publish to Maven Central #18
This file contains 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: workflow_dispatch | |
jobs: | |
publish: | |
name: 'Publish' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
java-package: jdk | |
check-latest: true | |
server-id: ossrh | |
server-username: OSSRH_USERNAME | |
server-password: OSSRH_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_KEY }} | |
gpg-passphrase: GPG_KEY_PASSPHRASE | |
- name: 'Set up GitHub credentials' | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Bloomberg Open Source" | |
- name: 'Publish snapshot to OSSRH' | |
run: mvn --batch-mode -Possrh -Darguments="-Dmaven.test.skip=true -Dspotbugs.skip=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} -Dusername=${{ secrets.GITHUB_TOKEN }}" release:prepare release:perform | |
env: | |
GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |