File tree 2 files changed +43
-9
lines changed
2 files changed +43
-9
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,45 @@ addons:
10
10
before_cache :
11
11
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
12
12
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
13
+ - rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin
14
+ - rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.lock
13
15
14
16
cache :
15
17
directories :
16
18
- $HOME/.gradle/caches/
17
19
- $HOME/.gradle/wrapper/
18
20
19
- matrix :
20
- fast_finish : true
21
- include :
22
- - jdk : oraclejdk8
23
- after_success : " ./gradlew jacocoRootReport coveralls sonarqube"
24
- - jdk : oraclejdk11
21
+ stages :
22
+ - test
23
+ - deploy
25
24
26
- script : " ./gradlew clean check install"
25
+ env :
26
+ - JOB=check
27
+
28
+ jobs :
29
+ fast_finish : true
30
+
31
+ allow_failures :
32
+ - env : JOB=sonatype
33
+
34
+ include :
35
+ # JDK 8
36
+ - name : " Java 8"
37
+ stage : test
38
+ jdk : oraclejdk8
39
+ script : ./gradlew check install jacocoRootReport
40
+ after_success : ./gradlew coveralls sonarqube
41
+
42
+ # JDK 11
43
+ - name : " Java 11"
44
+ stage : test
45
+ jdk : oraclejdk11
46
+ script : ./gradlew check install
47
+
48
+ - name : " Publish to Sonatype"
49
+ stage : deploy
50
+ jdk : oraclejdk8
51
+ env : JOB=sonatype
52
+ if : branch = master AND type = push
53
+ # Only automate the publication of SNAPSHOTS
54
+ script : if [[ $(./gradlew -q getVersion) == *SNAPSHOT* ]]; then ./gradlew publish ; fi
Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ subprojects { subproj ->
207
207
}
208
208
repositories {
209
209
maven {
210
- def sonatypeUsername = project. hasProperty(' ossrhUsername' ) ? ossrhUsername : " "
211
- def sonatypePassword = project. hasProperty(' ossrhPassword' ) ? ossrhPassword : " "
210
+ def sonatypeUsername = project. hasProperty(' ossrhUsername' ) ? ossrhUsername : System . getenv( " SONATYPE_USERNAME " ) ?: " "
211
+ def sonatypePassword = project. hasProperty(' ossrhPassword' ) ? ossrhPassword : System . getenv( " SONATYPE_PASSWORD " ) ?: " "
212
212
if (version. endsWith(" SNAPSHOT" )) {
213
213
url " https://oss.sonatype.org/content/repositories/snapshots/"
214
214
} else {
@@ -369,4 +369,10 @@ configure(rootProject) {
369
369
tasks. coveralls {
370
370
dependsOn ' jacocoRootReport'
371
371
}
372
+
373
+ task getVersion {
374
+ doLast {
375
+ println project. version
376
+ }
377
+ }
372
378
}
You can’t perform that action at this time.
0 commit comments