diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 64b848b..c6ef9db 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -6,6 +6,9 @@ name: Maven Package on: release: types: [created] + pull_request: + branches: + - main jobs: build: @@ -17,10 +20,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file @@ -29,6 +32,7 @@ jobs: run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven + if: github.event_name == 'release' run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml env: GITHUB_TOKEN: ${{ github.token }}