From 0e2c59696cfd7ac4c503690d0a7a11a8f4d55d23 Mon Sep 17 00:00:00 2001 From: Thomas Luechtefeld Date: Sat, 24 Feb 2024 20:23:53 -0500 Subject: [PATCH] created pypi_publish action --- .github/workflows/pypi_publish.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pypi_publish.yml diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 0000000..b2b87cd --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,31 @@ +name: Publish Python package to PyPI + +on: + push: + branches: + - master # Set this to your default branch + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' # Use the Python version compatible with your project + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master') + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + password: ${{ secrets.PYPI_TOKEN }} + user: __token__