Skip to content

Commit 076b715

Browse files
committed
πŸ‘·πŸ“¦πŸš€ Enable Travis CI to publish dists to PYPI
Resolves #222 @Mariatta still needs to update secret
1 parent 96052d9 commit 076b715

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

β€Ž.travis.ymlβ€Ž

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: = 0
2+
13
language: python
24
python:
35
- "3.5"
@@ -18,8 +20,11 @@ install:
1820
script:
1921
- blurb test
2022

23+
if: tag IS blank OR tag =~ ^blurb\-v\\d+\\.\\d+\\.\\d+$
24+
2125
.mixtures:
2226
- &install-and-test-cherry-picker
27+
if: tag IS blank OR tag =~ ^cherry\-picker\-v\\d+\\.\\d+\\.\\d+$
2328
install:
2429
- pushd cherry_picker
2530
- flit install
@@ -28,6 +33,33 @@ script:
2833
- pushd cherry_picker
2934
- pytest cherry_picker/test.py -v
3035
- popd
36+
- &deploy-base
37+
stage: Publish dists to PYPI
38+
python: "3.6-dev"
39+
script:
40+
- flit build
41+
# Add an empty setup.py stub, because pypi provider always calls it
42+
- touch setup.py
43+
deploy:
44+
provider: pypi
45+
# `skip-cleanup: true` is required to preserve binary wheel and sdist,
46+
# built by during `install` step above.
47+
skip-cleanup: true
48+
# `skip-existing: true` is required to skip uploading dists, already
49+
# present in PYPI instead of failing the whole process.
50+
# This happenes when other CI (AppVeyor etc.) has already uploaded
51+
# the very same dist (usually sdist).
52+
skip-existing: true
53+
user: Mariatta # TODO: consider having a separate "uploader user"
54+
# with reduced priviliges for security reasons
55+
password:
56+
# Encrypt with `travis encrypt -r python/core-workflow --org` while using travis-ci.org;
57+
# change to `travis encrypt -r python/core-workflow --api-endpoint 'https://api.travis-ci.com/'`
58+
# upon switch to __free__ travis-ci.com:
59+
secure: PLACE_YOUR_ENCRYPTED_PASSWORD_HERE
60+
on:
61+
tags: true
62+
all_branches: true
3163
jobs:
3264
include:
3365
- python: "3.6-dev"
@@ -36,3 +68,17 @@ jobs:
3668
<<: *install-and-test-cherry-picker
3769
- python: "nightly"
3870
<<: *install-and-test-cherry-picker
71+
72+
- <<: *deploy-base
73+
if: tag =~ ^cherry\-picker\-v\\d+\\.\\d+\\.\\d+$
74+
env:
75+
TARGET_PKG=cherry-picker
76+
install:
77+
- pushd cherry_picker
78+
79+
- <<: *deploy-base
80+
if: tag =~ ^blurb\-v\\d+\\.\\d+\\.\\d+$
81+
env:
82+
TARGET_PKG=cherry-picker
83+
install:
84+
- pushd blurb

0 commit comments

Comments
Β (0)