From 030fe855237b3b82c71c81464f81c84cce60cdfe Mon Sep 17 00:00:00 2001 From: Illia Shestakov Date: Mon, 16 Sep 2024 22:32:15 +0300 Subject: [PATCH] Publish releases to TestPyPI --- .github/workflows/publish-to-test-pypi.yml | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 2411f18..433d454 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -13,7 +13,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Install pypa/build run: >- python3 -m @@ -27,3 +26,28 @@ jobs: with: name: python-package-distributions path: dist/ + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/tutor-contrib-mailpit + + 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/