From 00bb3e9b5a836dfdea6ba10d72ec7a50558d7f7f Mon Sep 17 00:00:00 2001 From: zhengp0 Date: Wed, 16 Dec 2020 18:31:32 -0800 Subject: [PATCH] add deploy job to workflow --- .github/workflows/python-build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 11d07e8..a79e421 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -15,3 +15,24 @@ jobs: run: python -m pip install .[dev] --upgrade pip - name: Test with pytest run: pytest + + deploy: + + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + + steps: + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Build package distribution + run: | + python -m pip install build --upgrade pip + python -m build --sdist --wheel --outdir dist/ . + - name: Publish package distribution to PyPI + uses: pypa/gh-action-pypi-publish@main + with: + skip_existing: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}