diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index 6de8410..fd0d3ba 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -1,6 +1,6 @@ -name: Publish Python 🐍 distribution 📦 to PyPI -on: - workflow_dispatch: +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: push jobs: build: @@ -10,10 +10,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Install pypa/build run: >- python3 -m @@ -36,14 +35,14 @@ jobs: - build runs-on: ubuntu-latest environment: - name: release + name: pypi url: https://pypi.org/p/wqio # Replace with your PyPI project name permissions: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download all the dists - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ @@ -64,7 +63,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ @@ -92,3 +91,27 @@ jobs: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}' + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/wqio + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/