name: Publish package to GitHub Packages
on:
  release:
    types: [created]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          persist-credentials: false
      - name: Set up Java for publishing to GitHub Packages
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Publish to GitHub Packages
        run: mvn --file pom.xml -B deploy -Dmaven.wagon.http.pool=false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
