Search code examples
pythontravis-cipypi

Deploy only if all builds succeeded


I am using Travis and I want to deploy my application to PyPI if and only if all the builds succeed (and, of course, if it was a tagged commit that triggered deployment in the first place). Currently, Travis tries to upload it trice (once for Python 3.4, Python 3.5 and Python 3.6, respectively), and thus two out of three builds fail.

This is my .travis.yml:

language: python
python:
- '3.4'
- '3.5'
- '3.6'
install:
- pip install 'pytest>=4.0' pytest-cov python-coveralls
script:
- python3 -m pytest -v tests --cov=package
deploy:
  provider: pypi
  user: user
  password:
    secure: spameggs
  skip_cleanup: true
  on:
    tags: true
after_success:
- coveralls

How can I deploy my application to PyPI only after all builds succeed?


Solution

  • There is no way to wait for other builds to complete.

    To avoid uploading the same artifact multiple times, use skip_existing.