diff --git a/.github/workflows/build-publish-pypi.yml b/.github/workflows/build-publish-pypi.yml index 57303ee0..8359da62 100644 --- a/.github/workflows/build-publish-pypi.yml +++ b/.github/workflows/build-publish-pypi.yml @@ -50,8 +50,32 @@ jobs: path: dist/*.tar.gz retention-days: 1 + publish-to-testpypi: + name: Upload to TestPyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/xraylib + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + upload_pypi: - name: Upload to pypi + name: Upload to PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi