/
.travis.yml
83 lines (82 loc) · 2.43 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
if: NOT tag =~ ^ci/
language: java
matrix:
include:
- os: linux
jdk: oraclejdk9
- os: linux
jdk: openjdk8
- os: linux
jdk: openjdk10
sudo: false
addons:
apt:
update: true
before_install:
- cp .travis.settings.xml $HOME/.m2/settings.xml
- if [[ "$TRAVIS_OS_NAME" = linux ]]; then sudo apt-get install jshon ; fi
- mkdir -p $HOME/.script
- curl https://report.ci/annotate.py -o $HOME/.script/annotate.py --retry 5
- curl https://report.ci/upload.py -o $HOME/.script/upload.py --retry 5
- curl https://codecov.io/bash -o $HOME/.script/codecov.bash --retry 5 -k
- chmod +x $HOME/.script/codecov.bash
- chmod +x .travisci/*.sh
install:
- "mvn dependency:resolve dependency:resolve-plugins project-info-reports:plugin-management project-info-reports:dependencies"
- .travisci/getcodacy.sh
script:
- set -o pipefail
- "mvn -e clean install 2>&1 | tee maven.log"
after_failure:
- set +o pipefail
- rm -rf target/local-repo
- .travisci/reportci.sh
after_success:
- set +o pipefail
- rm -rf target/local-repo
- .travisci/reportci.sh
- .travisci/coverage.sh
- "mvn site"
before_deploy:
- git config --local user.name "powerunitci"
- git config --local user.email "powerunitci@powerunit.ch"
- if [[ "$TRAVIS_TAG" =~ powerunit-extensions-matchers-[0-9].[0-9].[0-9] ]]; then echo "No tag to be created" ; else git tag -m "Create ci tag [ci skip]" -f "ci/$TRAVIS_BRANCH/$TRAVIS_BUILD_NUMBER"; fi
- "mvn org.apache.maven.plugins:maven-changes-plugin:announcement-generate"
- export RELEASE_NOTES=$(jshon -s "$(cat target/announcement/announcement.vm)")
deploy:
- provider: pages
skip-cleanup: true
keep-history: false
github-token: $GITHUB_TOKEN
local-dir: target/site
on:
branch: master
condition: $TRAVIS_JDK_VERSION = openjdk8
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: target/*.jar
skip_cleanup: true
prerelease: true
draft: false
body: "$RELEASE_NOTES"
on:
branch: master
tags: false
condition: $TRAVIS_JDK_VERSION = openjdk8
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: target/*.jar
skip_cleanup: true
prerelease: false
draft: false
body: "$RELEASE_NOTES"
on:
tags: true
condition: $TRAVIS_JDK_VERSION = openjdk8 && "$TRAVIS_TAG" =~ powerunit-extensions-matchers-[0-9].[0-9].[0-9]
cache:
directories:
- $HOME/.m2/repository
before_cache:
- rm -rf $HOME/.m2/repository/ch/powerunit