forked from EsotericSoftware/kryo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (36 loc) · 1.49 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# needed for jdk8:
# https://travis-ci.community/t/solved-oraclejdk8-installation-failing-still-again/3428
# https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment
dist: trusty
# use container
sudo: false
language: java
env:
global:
# Check if version is a SNAPSHOT - grep returns 0 if the pattern is found, otherwise 1
- IS_SNAPSHOT=$(grep -A 1 "<artifactId>kryo.*</artifactId>" pom.xml | grep SNAPSHOT)
- SONATYPE_USERNAME=martin.grotzke
- secure: kCOLgEveEDprSL3fOBeCc1/nmHVYEcNh/lRRWiJywFehOzKBTBF40pAWX7JtsWUPG8aPKGYFEE4sjYd+DF2DRknbuB2ZfAEgs9Xp9h5Mx1KztJYNiCfEnLciBBRDXA7t1M3TLKyT3ptA+Kk307cH2QHv9sUUnhnf0IofJyQhQvA=
jdk:
- openjdk11
install:
# build with java 11
- mvn install -DskipTests=true -B -V
script:
# run tests with java 11
- mvn test -B
# run tests with java 8
- jdk_switcher use openjdk8
- mvn -v && mvn -B test
# install and publish snapshot with java 8
# not via `after_success` but directly in `script`, since a failure would be silently ignored in `after_success`, which
# is documented in https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build
- if [ $TRAVIS_BRANCH = "master" ] && [ $TRAVIS_PULL_REQUEST = "false" ] && [ $IS_SNAPSHOT ]; then
mvn -v && mvn -B -P requireSnapshot -DskipTests=true deploy --settings build/settings-sonatype.xml;
else
echo "Skipping deployment...";
fi
#- mvn -B -P requireSnapshot -DskipTests=true deploy --settings .settings.xml
cache:
directories:
- $HOME/.m2