Skip to content

Commit

Permalink
Use oidc pypi publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Mar 29, 2024
1 parent 5053bf8 commit 8b16e71
Showing 1 changed file with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

jobs:
publish:
release-build:

runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -23,10 +23,29 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- name: Build
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 8b16e71

Please sign in to comment.