From 8cc72db6ba3c24c93f38d41b464096c2e4a1cf5c Mon Sep 17 00:00:00 2001 From: Hemang Date: Thu, 17 Apr 2025 07:26:24 +0200 Subject: [PATCH] Add PyPi publish action. --- .github/workflows/publish_pypi.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish_pypi.yml diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..8b80500 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,36 @@ +name: Publish to PyPI + +on: + workflow_dispatch: + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: pypi-package + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12.2 + uses: actions/setup-python@v4 + with: + python-version: "3.12.2" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package + run: | + python -m build + + # TODO: Run tests against the built wheel + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m twine upload dist/* \ No newline at end of file