commit:     57f47ee0e28cfbabb833d863b384d5977d8412ee
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 21 06:00:44 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 21 06:00:44 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=57f47ee0

ci: use new PyPI OIDC publish

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .github/workflows/release.yml | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index af0b9d085..5f7e69315 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,6 +9,11 @@ on:
 jobs:
   build-and-deploy:
     runs-on: ubuntu-latest
+    environment: release
+
+    permissions:
+      id-token: write # Used to authenticate to PyPI via OIDC
+
     steps:
     - name: Checkout code
       uses: actions/checkout@v3
@@ -49,19 +54,9 @@ jobs:
         name: results
         path: dist/*
 
-    - name: Install twine and check files
-      run: |
-        pip install twine wheel-inspect
-        twine check dist/*
-        wheel2json dist/*.whl
-
-    - name: Upload to PyPI
-      env:
-        TWINE_USERNAME: __token__
-        TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
+    - name: publish
+      uses: pypa/gh-action-pypi-publish@release/v1
       if: startsWith(github.ref, 'refs/tags/')
-      run: |
-        twine upload dist/*
 
     - name: Create GitHub release
       uses: softprops/action-gh-release@v1

Reply via email to