From 0b240b9eb4b99d1458286610c6a52111b3135083 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 14 Oct 2023 12:24:04 +0200 Subject: [PATCH] Define Github Action for test-PyPI publication --- .github/workflows/publish-to-test-pypi.yml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..53393b4 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,38 @@ +name: Publish Python package to TestPyPI + +on: + push: + tags: + - '*' + +jobs: + publish: + name: Publish to TestPyPI + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # Only run on tagged commits + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install pypa/build/setuptools/twine + run: >- + python3 -m + pip install + build setuptools twine + --user + + - name: Build a binary wheel and a source tarball + run: python3 -m build + + - name: Publish to TestPyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* +