File tree 2 files changed +33
-5
lines changed
2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change
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
+
4
+ name : Maven Package
5
+
6
+ on :
7
+ push :
8
+ branches : [main]
9
+
10
+ jobs :
11
+ ci-pipeline :
12
+
13
+ runs-on : ubuntu-latest
14
+ permissions :
15
+ contents : read
16
+ packages : write
17
+
18
+ steps :
19
+ - uses : actions/checkout@v3
20
+ - name : Set up JDK 11
21
+ uses : actions/setup-java@v3
22
+ with :
23
+ java-version : ' 11'
24
+ distribution : ' temurin'
25
+
26
+ - name : Test with Maven
27
+ run : mvn test
Original file line number Diff line number Diff line change 4
4
name : Maven Package
5
5
6
6
on :
7
- push :
8
- branches : [main]
7
+ release :
8
+ types : [published]
9
+ workflow_dispatch : # enable manual workflow run
9
10
10
11
jobs :
11
12
build-and-release :
@@ -25,11 +26,11 @@ jobs:
25
26
server-id : github # Value of the distributionManagement/repository/id field of the pom.xml
26
27
settings-path : ${{ github.workspace }} # location for the settings.xml file
27
28
28
- - name : Test with Maven
29
- run : mvn test
29
+ - name : Update version in pom.xml (Release only)
30
+ run : mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
30
31
31
32
- name : Build with Maven
32
- run : mvn -B package --file pom.xml
33
+ run : mvn -B package --file pom.xml -Dmaven.test.skip=true
33
34
34
35
- name : Publish to GitHub Packages Apache Maven
35
36
run : mvn deploy -s $GITHUB_WORKSPACE/settings.xml
You can’t perform that action at this time.
0 commit comments