diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..730bd5c4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + release: + types: [ published ] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Run tox + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m tox -e release diff --git a/.gitignore b/.gitignore index 442b40dc..6adefab6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ !*.py !*.pyi !*.toml +!*.yml diff --git a/tox.ini b/tox.ini index 1234ed71..20496c2e 100644 --- a/tox.ini +++ b/tox.ini @@ -22,3 +22,15 @@ commands = basepython = python3.8 deps = mypy commands = mypy src/client + +[testenv:release] +basepython = python3.8 +deps = + build + twine +passenv = + TWINE_USERNAME + TWINE_PASSWORD +commands = + python -m build --sdist --wheel . + twine upload dist/*