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/