File tree Expand file tree Collapse file tree 5 files changed +46
-5
lines changed Expand file tree Collapse file tree 5 files changed +46
-5
lines changed Original file line number Diff line number Diff line change 5151 clean deploy scm:tag \
5252 -P release \
5353 -Drevision=${{ github.event.inputs.release-version }} \
54+ -Dchangelist= \
5455 -Dmessage="Release ${{ github.event.inputs.release-version }}" \
5556 -Dgpg.passphrase=${{ secrets.GPG_KEY_PASS }}
Original file line number Diff line number Diff line change @@ -26,17 +26,55 @@ jobs:
2626 strategy :
2727 matrix :
2828 java-version : [11, 17]
29+ include :
30+ - java-version : 11
31+ mvn-goal : deploy
32+ - java-version : 17
33+ mvn-goal : verify
34+
2935
3036 steps :
3137 - uses : actions/checkout@v3
38+
3239 - name : Set up JDK ${{ matrix.java-version }}
3340 uses : actions/setup-java@v3
3441 with :
3542 java-version : ${{ matrix.java-version }}
3643 distribution : ' adopt'
3744 cache : maven
45+
46+ - name : Prepare maven settings.xml
47+ run : |
48+ mkdir -p ~/.m2
49+ cat << EOF >~/.m2/settings.xml
50+ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
51+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
52+ <servers>
53+ <server>
54+ <id>nlic-snapshots</id>
55+ <username>${{ secrets.SNAPSHOTS_USER }}</username>
56+ <password>${{ secrets.SNAPSHOTS_PASS }}</password>
57+ </server>
58+ </servers>
59+ </settings>
60+ EOF
61+
62+ - name : Calculate branch suffix
63+ run : |
64+ if [ "$GITHUB_REF_NAME" = "master" ]
65+ then
66+ # No suffix when running against "master" branch
67+ BRANCH_SUFFIX=
68+ else
69+ # When running from pull request, use "-pr-<N>" suffix, where <N> is a PR number
70+ BRANCH_SUFFIX=-pr-${GITHUB_REF_NAME//\/merge/}
71+ fi
72+ echo "Branch suffix: '$BRANCH_SUFFIX'"
73+ echo "BRANCH_SUFFIX=$BRANCH_SUFFIX" >> "$GITHUB_ENV"
74+
3875 - name : Build with Maven
39- run : mvn -B clean verify
76+ run : mvn -B clean ${{ matrix.mvn-goal }} -Drepo.snapshots.url=${{ secrets.SNAPSHOTS_URL }} -Dsha1=$BRANCH_SUFFIX
77+
4078 - name : Run Demo App
4179 run : |
4280 ls -la NetLicensingClient-demo/target/
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >com.labs64.netlicensing</groupId >
88 <artifactId >netlicensing-client-parent</artifactId >
9- <version >${revision} </version >
9+ <version >${revision}${sha1}${changelist} </version >
1010 </parent >
1111
1212 <artifactId >netlicensing-client-demo</artifactId >
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >com.labs64.netlicensing</groupId >
88 <artifactId >netlicensing-client-parent</artifactId >
9- <version >${revision} </version >
9+ <version >${revision}${sha1}${changelist} </version >
1010 </parent >
1111
1212 <artifactId >netlicensing-client</artifactId >
Original file line number Diff line number Diff line change 44 <modelVersion >4.0.0</modelVersion >
55 <groupId >com.labs64.netlicensing</groupId >
66 <artifactId >netlicensing-client-parent</artifactId >
7- <version >${revision} </version >
7+ <version >${revision}${sha1}${changelist} </version >
88 <packaging >pom</packaging >
99 <name >Labs64 :: NetLicensing :: Client :: Parent</name >
1010 <url >https://netlicensing.io</url >
6363 </modules >
6464
6565 <properties >
66- <revision >2.10.0-SNAPSHOT</revision >
66+ <revision >2.10.0</revision >
67+ <changelist >-SNAPSHOT</changelist >
68+ <sha1 />
6769 <project .title>${project.name} </project .title>
6870 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
6971
You can’t perform that action at this time.
0 commit comments