Skip to content

Commit 3fa7c7f

Browse files
authored
Use OIDC for publishing to pypi (#687)
1 parent ff3eb55 commit 3fa7c7f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
needs: [compile, test]
4545
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
4646
runs-on: ubuntu-24.04
47+
permissions:
48+
id-token: write
49+
contents: read
4750
steps:
4851
- name: Checkout repo
4952
uses: actions/checkout@v3
@@ -56,10 +59,7 @@ jobs:
5659
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
5760
- name: Install dependencies
5861
run: poetry install
59-
- name: Publish to pypi
60-
run: |
61-
poetry config repositories.remote https://upload.pypi.org/legacy/
62-
poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"
63-
env:
64-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
65-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
62+
- name: Build package
63+
run: poetry build
64+
- name: Publish to PyPI
65+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)