@@ -2,11 +2,12 @@ name: Java CI on Push
22
33on :
44 push :
5+ branches :
6+ - ' maintenance/*'
57 workflow_dispatch :
68
79jobs :
8- build-java-8 :
9- if : github.ref == 'refs/heads/maintenance/*'
10+ build :
1011 strategy :
1112 matrix :
1213 java : [ 8, 11, 17 ]
2324 - name : Build with Maven
2425 run : mvn -fae -U -B clean license:check install -P check --file pom.xml
2526
26- build-java-11 :
27- if : github.ref == 'refs/heads/maintenance/*'
28- strategy :
29- matrix :
30- java : [ 11, 17 ]
31- runs-on : ubuntu-latest
32- name : Java ${{ matrix.java }} compile
33-
34- steps :
35- - uses : actions/checkout@v3
36- - name : Set up JDK ${{ matrix.java }}
37- uses : actions/setup-java@v3
38- with :
39- distribution : ' temurin'
40- java-version : ${{ matrix.java }}
41- - name : Build with Maven
42- run : mvn -fae -U -B clean license:check install -P check --file pom.xml
43-
44- publish-snapshot-java-8 :
45- if : github.ref == 'refs/heads/maintenance/*'
27+ publish-snapshot :
4628 needs : build-java-8
4729 runs-on : ubuntu-latest
4830 steps :
6042 env :
6143 MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
6244 MAVEN_PASSWORD : ${{ secrets.OSSRH_TOKEN }}
63-
64- publish-snapshot-java-11 :
65- if : github.ref != 'refs/heads/maintenance/*'
66- needs : build-java-11
67- runs-on : ubuntu-latest
68- steps :
69- - uses : actions/checkout@v3
70- - name : Set up settings.xml for GitHub Packages
71- uses : actions/setup-java@v3
72- with :
73- distribution : ' temurin'
74- java-version : 11
75- server-id : sonatype-nexus-snapshots
76- server-username : MAVEN_USERNAME
77- server-password : MAVEN_PASSWORD
78- - name : Publish SNAPSHOT version Maven Central
79- run : mvn -B --no-transfer-progress deploy -DskipTests
80- env :
81- MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
82- MAVEN_PASSWORD : ${{ secrets.OSSRH_TOKEN }}
83-
45+
0 commit comments