diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..f6560fe --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,30 @@ +name: Publish Python distribution to PyPI and TestPyPI + +on: push + +jobs: + build-n-publish: + name: Build and public Python distribution to PyPI and TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install pypa/build + run: >- + python -m pip install --user ".[build]" + - name: Build a binary wheel and a source tarball + run: >- + python -m build --sdist --wheel --outdir dist/ + - name: Publish Distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TESTPYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish Distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-public@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 69eaef6..c38e9f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ tests = isort<5,>=4.2.5 build = - pep517 + build docs = sphinx