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 51
51
clean deploy scm:tag \
52
52
-P release \
53
53
-Drevision=${{ github.event.inputs.release-version }} \
54
+ -Dchangelist= \
54
55
-Dmessage="Release ${{ github.event.inputs.release-version }}" \
55
56
-Dgpg.passphrase=${{ secrets.GPG_KEY_PASS }}
Original file line number Diff line number Diff line change @@ -26,17 +26,55 @@ jobs:
26
26
strategy :
27
27
matrix :
28
28
java-version : [11, 17]
29
+ include :
30
+ - java-version : 11
31
+ mvn-goal : deploy
32
+ - java-version : 17
33
+ mvn-goal : verify
34
+
29
35
30
36
steps :
31
37
- uses : actions/checkout@v3
38
+
32
39
- name : Set up JDK ${{ matrix.java-version }}
33
40
uses : actions/setup-java@v3
34
41
with :
35
42
java-version : ${{ matrix.java-version }}
36
43
distribution : ' adopt'
37
44
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
+
38
75
- 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
+
40
78
- name : Run Demo App
41
79
run : |
42
80
ls -la NetLicensingClient-demo/target/
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >com.labs64.netlicensing</groupId >
8
8
<artifactId >netlicensing-client-parent</artifactId >
9
- <version >${revision} </version >
9
+ <version >${revision}${sha1}${changelist} </version >
10
10
</parent >
11
11
12
12
<artifactId >netlicensing-client-demo</artifactId >
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >com.labs64.netlicensing</groupId >
8
8
<artifactId >netlicensing-client-parent</artifactId >
9
- <version >${revision} </version >
9
+ <version >${revision}${sha1}${changelist} </version >
10
10
</parent >
11
11
12
12
<artifactId >netlicensing-client</artifactId >
Original file line number Diff line number Diff line change 4
4
<modelVersion >4.0.0</modelVersion >
5
5
<groupId >com.labs64.netlicensing</groupId >
6
6
<artifactId >netlicensing-client-parent</artifactId >
7
- <version >${revision} </version >
7
+ <version >${revision}${sha1}${changelist} </version >
8
8
<packaging >pom</packaging >
9
9
<name >Labs64 :: NetLicensing :: Client :: Parent</name >
10
10
<url >https://netlicensing.io</url >
63
63
</modules >
64
64
65
65
<properties >
66
- <revision >2.10.0-SNAPSHOT</revision >
66
+ <revision >2.10.0</revision >
67
+ <changelist >-SNAPSHOT</changelist >
68
+ <sha1 />
67
69
<project .title>${project.name} </project .title>
68
70
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
69
71
You can’t perform that action at this time.
0 commit comments