Skip to content

Commit 9113eaa

Browse files
Merge pull request #28 from ObrienlabsDev/codex/add-pre-merge-maven-build-step-to-github-workflow
Run Maven build for pull requests
2 parents 943f517 + 753c33d commit 9113eaa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/maven-publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ name: Maven Package
66
on:
77
release:
88
types: [created]
9+
pull_request:
10+
branches:
11+
- main
912

1013
jobs:
1114
build:
@@ -17,10 +20,10 @@ jobs:
1720

1821
steps:
1922
- uses: actions/checkout@v4
20-
- name: Set up JDK 11
23+
- name: Set up JDK 17
2124
uses: actions/setup-java@v4
2225
with:
23-
java-version: '11'
26+
java-version: '17'
2427
distribution: 'temurin'
2528
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2629
settings-path: ${{ github.workspace }} # location for the settings.xml file
@@ -29,6 +32,7 @@ jobs:
2932
run: mvn -B package --file pom.xml
3033

3134
- name: Publish to GitHub Packages Apache Maven
35+
if: github.event_name == 'release'
3236
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
3337
env:
3438
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)