publish.yml 858 B

12345678910111213141516171819202122232425262728
  1. name: Deploy to Maven Central
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [created]
  6. jobs:
  7. publish:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - name: Set up Maven Central Repository
  12. uses: actions/setup-java@v3
  13. with:
  14. java-version: '17'
  15. distribution: 'temurin'
  16. - name: Set maven settings.xml
  17. uses: whelk-io/maven-settings-xml-action@v20
  18. with:
  19. servers: '[{ "id": "ossrh", "username": "jplag", "password": "${{ secrets.OSSRH_TOKEN }}" }]'
  20. - name: Import GPG key
  21. uses: crazy-max/ghaction-import-gpg@v4
  22. with:
  23. gpg_private_key: ${{ secrets.PGP_SECRET }}
  24. passphrase: ${{ secrets.PGP_PW }}
  25. - name: Publish package
  26. run: mvn --batch-mode deploy
  27. env:
  28. GPG_PASSPHRASE: ${{ secrets.PGP_PW }}