-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
98 lines (97 loc) · 2.67 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
language: python
dist: trusty
sudo: false
branches:
except:
- /^v\d+\.*$/
- /^tavis-.*$/
- /^untagged.*/
env:
global:
- GITHUB_OWNER=engapa
- GITHUB_REPO=modeldb-basic
matrix:
include:
- python: "2.7"
env:
- FLAG=false
TOXENV=py27
- python: "3.5"
env:
- FLAG=false
TOXENV=py35
- python: "3.6"
env:
- FLAG=true
TOXENV=py36
- python: "3.7"
env:
- FLAG=true
TOXENV=py37
addons:
apt:
packages:
- gcc
- make
- libssl-dev
- python-pip
- python-dev
- build-essential
- jq
services:
- docker
install:
- travis_retry pip install tox
script:
- make test
- |
if [[ "$FLAG" == "true" ]]; then
make build
if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" ]]; then
pip install -U bumpversion gitchangelog pystache
git config --global user.email "builds@travis-ci.com"
git config --global user.name "Travis CI"
git pull -t
export TAG_VERSION_OLD=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout -b travis-master-$TRAVIS_BUILD_NUMBER origin/$TRAVIS_BRANCH
bumpversion --tag --commit --message "[skip ci] Travis Build ${TRAVIS_BUILD_NUMBER}. Update version {current_version} --> {new_version}" patch modeldb/__init__.py
export TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
gitchangelog > CHANGELOG.md
git add CHANGELOG.md && git commit -m "[skip ci] Generated CHANGELOG file" CHANGELOG.md
git tag -f $TAG_VERSION
sed -i.bak 's/changelog\.tpl/releasenotes\.tpl/g' .gitchangelog.rc
export ENV_RELEASE_NOTES=`gitchangelog $TAG_VERSION_OLD..HEAD`
export RELEASE_BODY=$(python -c "import json,os; print(json.dumps(os.environ['ENV_RELEASE_NOTES']).strip('\"'))")
export RELEASE_TAG=$TAG_VERSION
export RELEASE_DIR=$(pwd)/dist
fi
fi
after_success:
- if [[ "$FLAG" == "true" ]]; then
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -f .coverage;
fi
deploy:
# Publish artifacts to python repositories and create remote tag
- provider: script
skip_cleanup: true
script: >-
make clean build upload &&
git checkout master &&
git merge travis-master-$TRAVIS_BUILD_NUMBER &&
git push --tags https://$GITHUB_TOKEN@github.com/$GITHUB_OWNER/$GITHUB_REPO.git $TRAVIS_BRANCH
on:
branch: master
condition: $FLAG = true
# Publish on github releases
- provider: script
skip_cleanup: true
script: ./bin/gh-release.sh
on:
branch: master
condition: $FLAG = true
notifications:
email:
recipients:
- engapa@gmail.com
on_success: never # default: change
on_failure: always # default: always