Skip to content

Commit

Permalink
πŸ‘·πŸ“¦πŸš€ Enable Travis CI to publish dists to PYPI
Browse files Browse the repository at this point in the history
Resolves #222

@Mariatta still needs to update secret
  • Loading branch information
webknjaz committed Jun 10, 2018
1 parent ba23d83 commit e6113fc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: = 0

language: python
python:
- "3.5"
Expand All @@ -18,8 +20,11 @@ install:
script:
- blurb test

if: tag IS blank OR tag =~ ^blurb\-v\\d+\\.\\d+\\.\\d+$

.mixtures:
- &install-and-test-cherry-picker
if: tag IS blank OR tag =~ ^cherry\-picker\-v\\d+\\.\\d+\\.\\d+$
install:
- pushd cherry_picker
- flit install
Expand All @@ -28,6 +33,33 @@ script:
- pushd cherry_picker
- pytest cherry_picker/test.py -v
- popd
- &deploy-base
stage: Publish dists to PYPI
python: "3.6-dev"
script:
- flit build
# Add an empty setup.py stub, because pypi provider always calls it
- touch setup.py
deploy:
provider: pypi
# `skip-cleanup: true` is required to preserve binary wheel and sdist,
# built by during `install` step above.
skip-cleanup: true
# `skip-existing: true` is required to skip uploading dists, already
# present in PYPI instead of failing the whole process.
# This happenes when other CI (AppVeyor etc.) has already uploaded
# the very same dist (usually sdist).
skip-existing: true
user: Mariatta # TODO: consider having a separate "uploader user"
# with reduced priviliges for security reasons
password:
# Encrypt with `travis encrypt -r python/core-workflow --org` while using travis-ci.org;
# change to `travis encrypt -r python/core-workflow --api-endpoint 'https://api.travis-ci.com/'`
# upon switch to __free__ travis-ci.com:
secure: PLACE_YOUR_ENCRYPTED_PASSWORD_HERE
on:
tags: true
all_branches: true
jobs:
include:
- python: "3.6-dev"
Expand All @@ -36,3 +68,17 @@ jobs:
<<: *install-and-test-cherry-picker
- python: "nightly"
<<: *install-and-test-cherry-picker

- <<: *deploy-base
if: tag =~ ^cherry\-picker\-v\\d+\\.\\d+\\.\\d+$
env:
TARGET_PKG=cherry-picker
install:
- pushd cherry_picker

- <<: *deploy-base
if: tag =~ ^blurb\-v\\d+\\.\\d+\\.\\d+$
env:
TARGET_PKG=cherry-picker
install:
- pushd blurb

0 comments on commit e6113fc

Please sign in to comment.