diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..552a4ab --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,33 @@ +# via https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/# +name: Publish to PyPI +on: + release: + types: [published] +jobs: + build-n-publish: + name: Build and publish to PyPI + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@main + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution package to PyPI + # if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }}