Skip to content

Commit cb9b372

Browse files
committed
ci: use new PyPI OIDC publish
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 1d12caf commit cb9b372

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
jobs:
1010
build-and-deploy:
1111
runs-on: ubuntu-latest
12+
environment: release
13+
14+
permissions:
15+
id-token: write # Used to authenticate to PyPI via OIDC
16+
17+
contents: write # Used to authenticate github release publish
18+
1219
steps:
1320
- name: Checkout code
1421
uses: actions/checkout@v2
@@ -42,22 +49,19 @@ jobs:
4249
sha512sum dist/*
4350
tar -ztf dist/*.tar.gz | sort
4451
45-
- name: Install twine and check files
46-
run: |
47-
pip install twine wheel-inspect
48-
twine check dist/*
49-
wheel2json dist/*.whl
52+
- uses: actions/upload-artifact@v3
53+
with:
54+
name: results
55+
path: dist/*
5056

51-
- name: Upload to PyPI
52-
env:
53-
TWINE_USERNAME: __token__
54-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
57+
- name: publish
58+
uses: pypa/gh-action-pypi-publish@release/v1
5559
if: startsWith(github.ref, 'refs/tags/')
56-
run: twine upload dist/*
5760

5861
- name: Create GitHub release
5962
uses: softprops/action-gh-release@v1
6063
if: startsWith(github.ref, 'refs/tags/')
6164
with:
6265
files: dist/*.tar.gz
6366
fail_on_unmatched_files: true
67+
draft: true

0 commit comments

Comments
 (0)