diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 460ff55..0508273 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,3 +60,31 @@ jobs: - name: Run pytest run: | pytest -v tests/test.py + + + build-and-push-package: + runs-on: ubuntu-latest + needs: [check-code-format, run-tests] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + pip install wheel + + - name: Build package + run: | + python3 setup.py sdist bdist_wheel + + - name: Push package on PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}