Skip to content

Commit 5eda0ac

Browse files
authored
Merge pull request #11 from jgsogo/ci/tag-n-deploy
Deploy from Travis
2 parents 7017c57 + 63a2721 commit 5eda0ac

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

.travis.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
1+
stages:
2+
- test
3+
- name: deploy
4+
if: tag IS present
5+
16
language: python
2-
python:
3-
- "2.7"
4-
- "3.4"
5-
- "3.5"
6-
- "3.6"
7-
- "3.7"
8-
- "3.7-dev"
9-
- "3.8-dev"
107

118
install:
129
- pip install coverage
13-
- pip install pypack
14-
1510
script:
16-
# run tests with coverage
11+
# run tests and report coverage
1712
- coverage run tests/run_tests.py
18-
- coverage report -m
19-
# test distribution packaging
20-
- python -m pypack patch_ng.py
13+
- coverage report -m --omit=tests/run_tests.py
14+
15+
jobs:
16+
include:
17+
- stage: test
18+
python: 2.7
19+
- python: 3.4
20+
- python: 3.5
21+
- python: 3.6
22+
- python: 3.7
23+
- python: 3.8
24+
- stage: deploy
25+
install:
26+
script:
27+
- "PACKAGE_VERSION=$(cat patch_ng.py | grep __version__ | head -1 | awk -F= '{ print $2 }' | sed 's/[ \",]//g')"
28+
- echo "Deploying library version '$PACKAGE_VERSION'"
29+
- echo "Tagged in repo as '$TRAVIS_TAG'"
30+
- |
31+
if [ "$PACKAGE_VERSION" != "$TRAVIS_TAG" ]; then
32+
echo "Library version and tag name mismatch!"
33+
travis_terminate 1
34+
fi
35+
36+
deploy:
37+
provider: pypi
38+
user: __token__
39+
password:
40+
secure: ggKIZjlC4xLtBrWSSc+BR1lA5Y2eV8UcKwew+pwRy5j76PMYc7y+daW8HqaErIx2+aNcyY4Sh8cv3nJ2MntH3ZckmChCmDlXc7/q9gwMmX85f0on/i1LDhakxvtiOM5/FqaH06bIaqy6pEAurcjIVRXNJwgfOFQu86AGTAa92NCOkyBT2Sr9fWyEKN+ONalFPHCOmnXnj0AXYceQ5egV1G75LZnO8wzl6+05lUDUCwh1ooQbNo6flliFc5aRMCFESSjBOps08qZEt+/hromlSzYFtqX1gy3myNeGV/df2+nRs+X45YJjScnEXIcPDE9REbw1nY23r7FadCKPJT8CYOCSJ2e5TvGYvhbHSGGXU4hYZSdldGH9Ub+LaQyTXHvsoyWcQzhkdfAhpqJ3AIX1RKqK4C8B3Fr2lkbkEc7YuoSLXxx4Xg2DikyvqMBafUBzAlbtt5qP+nH9j1LOhe2ntXpo7z2y00zKQV6bC7QCyK2X7wItruW4z5kXXOOB6i/WjUa1XdL/3yYm4LJ5tkLKHUTB0tbwCQhWpymr9ZIiKVL/9WtVl/+erJ6YjxIwhRI+INFhyHAJF8mJI9ywF7y5DREIBfR27VkwDgm+Y0lobGyU+/1bWSxoYq7gzkRvoPoUW1xBMZ4koqDTCO5wBVz79EDCfpfm302kYjMW0NA9m5w=
41+
on:
42+
tags: true

0 commit comments

Comments
 (0)