浏览代码

Fix pypi deployments

Jelmer Vernooij 11 月之前
父节点
当前提交
281c15a4f4
共有 1 个文件被更改,包括 7 次插入9 次删除
  1. 7 9
      .github/workflows/python-distributions.yml

+ 7 - 9
.github/workflows/python-distributions.yml

@@ -63,18 +63,16 @@ jobs:
       - build-wheels
       - build-sdist
     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
+    permissions:
+      id-token: write
+    environment:
+      name: pypi
+      url: https://pypi.org/p/dulwich
     steps:
-      - name: Install twine
-        run: |
-          python -m pip install --upgrade pip
-          pip install twine
       - name: Download distributions
         uses: actions/download-artifact@v2
         with:
           name: artifact
           path: dist
-      - name: Publish distributions
-        env:
-          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
-          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
-        run: twine upload dist/*
+      - name: Publish package distributions to PyPI
+        uses: pypa/gh-action-pypi-publish@release/v1