publish.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Deploy to Maven Central & GitHub
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [created]
  6. jobs:
  7. publish-maven-central:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - uses: actions/setup-java@v3
  12. with:
  13. java-version: '17'
  14. distribution: 'temurin'
  15. - name: Set maven settings.xml
  16. uses: whelk-io/maven-settings-xml-action@v21
  17. with:
  18. servers: '[{ "id": "ossrh", "username": "jplag", "password": "${{ secrets.OSSRH_TOKEN }}" }]'
  19. - name: Import GPG key
  20. uses: crazy-max/ghaction-import-gpg@v5
  21. with:
  22. gpg_private_key: ${{ secrets.PGP_SECRET }}
  23. passphrase: ${{ secrets.PGP_PW }}
  24. - name: Publish package
  25. run: mvn -P deployment -U -B deploy
  26. env:
  27. GPG_PASSPHRASE: ${{ secrets.PGP_PW }}
  28. publish-release-artifact:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - uses: actions/checkout@v3
  32. - uses: actions/setup-java@v3
  33. with:
  34. java-version: '17'
  35. distribution: 'temurin'
  36. - name: Build JPlag
  37. run: mvn -U -B clean package assembly:single
  38. - name: Attach CLI to Release on GitHub
  39. uses: softprops/action-gh-release@v1
  40. if: startsWith(github.ref, 'refs/tags/')
  41. with:
  42. files: cli/target/jplag-*-jar-with-dependencies.jar
  43. fail_on_unmatched_files: true