diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index be8e546..7d8866a 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -3,8 +3,6 @@ on: push jobs: build: runs-on: ubuntu-latest - permissions: - id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -12,11 +10,33 @@ jobs: python-version: '3.10' - run: pip install --upgrade build - run: python -m build --sdist --wheel - - name: Publish to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + test: + needs: build + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true - - name: Publish to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 + publish: + if: startsWith(github.ref, 'refs/tags/') + needs: test + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1