diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fb451ad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: [push, release] + +jobs: + + push_release_to_pypi: + name: Push Package Release to PyPI + runs-on: ubuntu-18.04 + steps: + + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python 3.8 + with: + python-version: 3.8 + + - name: Install Tox + run: pip install tox + + - name: Build Source and Wheel Package + run: | + tox -e run-cmd -- python setup.py sdist + tox -e run-cmd -- python setup.py bdist_wheel + + - name: Check distribution files + run: tox -e run-cmd -- twine check dist/* + + - name: Publish package to Test-PyPI + if: github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/