File tree 1 file changed +26
-12
lines changed
1 file changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,30 @@ language: java
3
3
services :
4
4
- docker
5
5
6
- script : mvn clean test verify
6
+ stages :
7
+ - name : test
8
+ - name : build-and-deploy
9
+ if : tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$
7
10
8
- # Deployment configuration
9
- deploy :
10
- provider : releases
11
- api_key :
12
- secure : " $GITHUB_TOKEN" # You need to encrypt your API key
13
- file_glob : true
14
- file : target/*.jar # Specifies the JAR files to deploy
15
- skip_cleanup : true
16
- on :
17
- tags : true # Only deploy on tagged commits
18
- name : " Release: $TRAVIS_TAG"
11
+ jobs :
12
+ include :
13
+ - stage : test
14
+ script :
15
+ - mvn clean test verify
16
+
17
+ - stage : build-and-deploy
18
+ script :
19
+ - mvn help:evaluate -Dexpression=project.version -q -DforceStdout > version.txt
20
+ - export VERSION=$(cat version.txt)
21
+ - mvn package
22
+
23
+ deploy :
24
+ provider : releases
25
+ api_key :
26
+ secure : " $GITHUB_TOKEN" # You need to encrypt your API key
27
+ file_glob : true
28
+ file : target/*.jar # Specifies the JAR files to deploy
29
+ skip_cleanup : true
30
+ on :
31
+ tags : true # Only deploy on tagged commits
32
+ name : " Release: $TRAVIS_TAG"
You can’t perform that action at this time.
0 commit comments