From 3aec8ccbd57437362aea31d3dbfe6e0564915add Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 19:20:35 +0100 Subject: [PATCH] Add Github Action job for creating PyPI releases --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebcf45c930..a43a3b8a0d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,3 +55,28 @@ jobs: file: ./Dockerfile push: false tags: locustio/locust:latest + + release: + name: Release to PyPI + needs: verify_docker_build + if: startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build + run: | + python setup.py sdist bdist_wheel + - name: Publish to PyPI (Test) + + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}