language: python
os: linux
dist: bionic
python:
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"
install:
  - pip install -e .
script:
  - python -m unittest
jobs:
  include:
    - stage: deploy
      if: branch = master AND tag IS present
      python: 3.8
      script: skip
      deploy:
        provider: pypi
        edge: true
        username: $PYPI_USERNAME
        password: $PYPI_PASSWORD
        distributions: "sdist bdist_wheel"
        on:
          tags: true
          branch: master

language: python
os: linux
dist: bionic
python:
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"
install:
  - pip install -e .
script:
  - python -m unittest
jobs:
  include:
    - stage: deploy
      if: tag IS present
      python: 3.8
      script: skip
      deploy:
        provider: pypi
        edge: true
        username: $PYPI_USERNAME
        password: $PYPI_PASSWORD
        distributions: "sdist bdist_wheel"
        on:
          tags: true

Deploy all tagged commits to PyPI, even if not on master
Deploy all tagged commits to PyPI, even if not on master

Depending on the order commits are tagged vs. merged into master, a tag
may never be deployed under the old conditions.

Safer to deploy all tags, whether they are merged yet or not. Up to tagger
to ensure they are merged as appropriate.
