From a9d87f791f4d5cb65967bfc3e0c0efda293406e4 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Mon, 31 Jul 2023 18:08:50 -0600 Subject: [PATCH] Added Github workflow to publish to PyPI --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..152e6cc --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish to PyPI and TestPyPI + +on: + release: + types: [published] + +jobs: + publish: + name: Build and publish to PyPI and TestPyPI + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python + uses: actions/setup-python@v3 + - 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 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}