diff --git a/.github/workflows/pypi-ci.yml b/.github/workflows/pypi-ci.yml index 5b5b694..af5f314 100644 --- a/.github/workflows/pypi-ci.yml +++ b/.github/workflows/pypi-ci.yml @@ -44,8 +44,9 @@ jobs: deploy_test_PyPI: name: 📦 Deploy to TestPyPI runs-on: ubuntu-22.04 - needs: [build_wheels] - if: github.ref == 'refs/heads/main' + permissions: + id-token: write + steps: - name: Download artifacts uses: actions/download-artifact@v4 @@ -54,16 +55,17 @@ jobs: path: dist - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + skip-existing: true deploy_PyPI: name: 📦 Deploy to PyPI runs-on: ubuntu-22.04 - needs: [build_wheels] - if: startsWith(github.ref, 'refs/tags') + permissions: + id-token: write + steps: - name: Download artifacts uses: actions/download-artifact@v4 @@ -72,6 +74,6 @@ jobs: path: dist - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true