diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 000000000..f744d8336 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,22 @@ +name: Publish package to the Maven Central Repository +on: + pull_request: + types: [opened, reopened] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USER_NAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}