Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 084b51e

Browse files
webknjazMariatta
authored andcommitted
πŸ‘·πŸ“¦πŸš€ Enable Travis CI to publish dists to PyPI (#262)
Allow publishing cherry_picker to PyPI via Travis CI. Disable this for blurb. Resolves #222
1 parent c341234 commit 084b51e

File tree

1 file changed

+77
-14
lines changed

1 file changed

+77
-14
lines changed

β€Ž.travis.yml

+77-14
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,101 @@
1+
conditions: v1
2+
13
language: python
2-
python:
3-
- "3.5"
4-
- "3.6-dev"
5-
- "3.7-dev"
6-
- "nightly"
74

85
dist: trusty
96
sudo: false
107
cache: pip
118

129
before_install:
1310
- pip install --upgrade flit
14-
install:
15-
- pushd blurb
16-
- flit install
17-
- popd
18-
script:
19-
- blurb test
2011

2112
.mixtures:
13+
- &run-if-tagged
14+
if: tag IS present
15+
- &run-if-cherry-picker
16+
if: tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$
17+
- &run-if-blurb
18+
if: tag =~ ^blurb\-v\d+\.\d+\.\d+$
19+
- &run-if-cherry-picker-or-untagged
20+
if: tag IS NOT present OR tag =~ ^cherry\-picker\-v\d+\.\d+\.\d+$
21+
- &run-if-blurb-or-untagged
22+
if: tag IS NOT present OR tag =~ ^blurb\-v\d+\.\d+\.\d+$
2223
- &install-and-test-cherry-picker
24+
<<: *run-if-cherry-picker-or-untagged
25+
env:
26+
TARGET_PKG: cherry_picker
2327
install:
24-
- pushd cherry_picker
28+
- &cd-to-project pushd "$TARGET_PKG"
2529
- flit install
26-
- popd
2730
script:
28-
- pushd cherry_picker
2931
- pytest cherry_picker/test.py -v
3032
- popd
33+
- &install-and-test-blurb
34+
<<: *run-if-blurb-or-untagged
35+
env:
36+
TARGET_PKG: blurb
37+
install:
38+
- *cd-to-project
39+
- flit install
40+
- popd
41+
script:
42+
- blurb test
43+
- &deploy-base
44+
stage: Publish dists to PYPI
45+
<<: *run-if-tagged
46+
python: "3.6-dev"
47+
install:
48+
- *cd-to-project
49+
script:
50+
- flit build
51+
before_deploy:
52+
# Add an empty setup.py stub, because pypi provider always calls it
53+
- touch setup.py
54+
deploy: &deployment-config
55+
provider: pypi
56+
# `skip-cleanup: true` is required to preserve binary wheel and sdist,
57+
# built by during `install` step above.
58+
skip-cleanup: true
59+
# `skip-existing: true` is required to skip uploading dists, already
60+
# present in PyPI instead of failing the whole process.
61+
# This happenes when other CI (AppVeyor etc.) has already uploaded
62+
# the very same dist (usually sdist).
63+
skip-existing: true
64+
user: &pypi-user core-workflow
65+
password: &pypi-password
66+
# Encrypt with `travis encrypt -r python/core-workflow --org` while using travis-ci.org;
67+
# change to `travis encrypt -r python/core-workflow --api-endpoint 'https://api.travis-ci.com/'`
68+
# upon switch to __free__ travis-ci.com:
69+
secure: "bg1ZOOHlhaT+S3TQy2WpSsWekHaeZSq39kkZj/Ql3nvJ0ES+a+lTjk+gmuSnSX0Sf9V+88TdN5g1frYVcvYWwIQvLEQP2xhqIfq8K+MVe+GbshQGiTD4PC4f7vRcDY+B93X7cQ8HgkGho3c0/BaEaK6MtrS8WK7dIdHCPaea5D8rLF9jXtS2Lt8MYtqRDG1R2BsNN+o87eyr3qD3aJW6cFRPTHPr/x+gmlKuIJcVOwuVd4xyR701xRpE7hK5/bKvQwI2QZhD7wTyJwYqsl3Ce/ZlyS+IINktkFhD2BqH2ya4tdOHeVhA+b44eJEDXUR7gweyO+Ein5W3S3R2lDxHuX3Aq7nJBKHxU39kwcnPPaMRWYKey51d9zbIicmxjj5sLY0vPYmlX1zdbDUK9NqkdRf8aLzyowWFl3DtkXmyoakITOz9boqDIRiivTJQ/mLG8AFKgf0ms/z1yW4/PN+LoomdpmhQj05EfAJdAvdTw+ceteaeBSKc2uDql4Qj5AKUddeaoLQuPbWForfSPosv9DZZmvOXrmncY91HngrdclxFIssMtefQrC2USbQEIedih1cxfsXzwBrX7+f4eHH2MJt/GrOyNB0gaXc4sikYkaBKsIg7UCWC1/F4jmGkyDLlwp31zflZkjPKUJ3vp2SC9R6sHcT04tvxTVIMDCJgkc8="
70+
on:
71+
tags: true
72+
all_branches: true
73+
3174
jobs:
3275
include:
76+
- python: "3.5"
77+
<<: *install-and-test-blurb
78+
- python: "3.6-dev"
79+
<<: *install-and-test-blurb
80+
- python: "3.7-dev"
81+
<<: *install-and-test-blurb
82+
- python: "nightly"
83+
<<: *install-and-test-blurb
84+
3385
- python: "3.6-dev"
3486
<<: *install-and-test-cherry-picker
3587
- python: "3.7-dev"
3688
<<: *install-and-test-cherry-picker
3789
- python: "nightly"
3890
<<: *install-and-test-cherry-picker
91+
92+
- <<: *deploy-base
93+
<<: *run-if-cherry-picker
94+
env:
95+
TARGET_PKG: cherry_picker
96+
97+
- <<: *deploy-base
98+
<<: *run-if-blurb
99+
if: false
100+
env:
101+
TARGET_PKG: blurb

0 commit comments

Comments
Β (0)