maven-publish.yml 1000 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
  2. # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
  3. name: Maven Package
  4. on:
  5. release:
  6. types: [created]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: read
  12. packages: write
  13. steps:
  14. - uses: actions/checkout@v4
  15. - name: Set up JDK 17
  16. uses: actions/setup-java@v3
  17. with:
  18. java-version: '17'
  19. distribution: 'temurin'
  20. server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
  21. settings-path: ${{ github.workspace }} # location for the settings.xml file
  22. - name: Build with Maven
  23. run: mvn -B package --file pom.xml
  24. - name: Publish to GitHub Packages Apache Maven
  25. run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
  26. env:
  27. GITHUB_TOKEN: ${{ github.token }}