diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 873022f..ecbd80f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,25 @@ jobs: flags: pytests file: ./coverage.xml fail_ci_if_error: true + + publish: + name: Publish to PyPi + needs: [pre-commit, tests] + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Build package + run: | + pip install wheel + python setup.py sdist bdist_wheel + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.1.0 + with: + user: __token__ + password: ${{ secrets.PYPI_KEY }}