From ee295683df750c392bf68d30344d48ecc7130012 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Fri, 25 Oct 2024 15:43:28 +0200 Subject: [PATCH] Update pypi-ci.yml --- .github/workflows/pypi-ci.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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