From 1637f88dbada5abe33b363ca4680d6381ad129bd Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Mon, 18 Dec 2023 11:00:50 -0500 Subject: [PATCH] Add tag-based releases to publish to PyPI --- .github/workflows/deploy_to_pypi.yml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/deploy_to_pypi.yml diff --git a/.github/workflows/deploy_to_pypi.yml b/.github/workflows/deploy_to_pypi.yml new file mode 100644 index 0000000..4ad9424 --- /dev/null +++ b/.github/workflows/deploy_to_pypi.yml @@ -0,0 +1,30 @@ +name: Deploy to PyPI + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + build-and-release: + name: Build and Release + runs-on: ubuntu-20.04 + timeout-minutes: 5 + steps: + - name: Set Up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Check out code + uses: actions/checkout@v4 + - name: Install build dependencies + run: pip install build twine + - name: Build package + run: python -m build . + - name: Twine Check + run: twine check dist/* + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/*