From ab047a5ee9c9a1ca24e938c8fe6e0e7a38ed91d1 Mon Sep 17 00:00:00 2001 From: Gitjay11 Date: Sun, 15 Mar 2026 07:38:30 +0530 Subject: [PATCH] Add workflow to test package upload to TestPyPI --- .github/workflows/test-pypi-publish.yml | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test-pypi-publish.yml diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml new file mode 100644 index 00000000..283f8258 --- /dev/null +++ b/.github/workflows/test-pypi-publish.yml @@ -0,0 +1,44 @@ +name: Test Upload Python Package to TestPyPI + +on: + workflow_dispatch: + +jobs: + build: + name: Build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - run: pip install --upgrade build + - name: Build package + run: pyproject-build --sdist + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + overwrite: true + if-no-files-found: error + retention-days: 1 + + publish: + name: Upload release to TestPyPI + needs: build + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/pyprecice + permissions: + id-token: write + steps: + - name: Download package + uses: actions/download-artifact@v4 + with: + name: dist + path: dist + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/