chore: support trusted publisher to publish with OIDC (#888)
Some checks failed
Check tox tests / Check packaging 📦 (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Publish Python 🐍 distributions 📦 to PyPI / Build package (push) Has been cancelled
Publish Python 🐍 distributions 📦 to PyPI / publish Python 🐍 distributions 📦 to PyPI (push) Has been cancelled
Test on GH actions environment / test (binary, windows-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.5.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.0) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.1) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.5.3) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.7.3) (push) Has been cancelled

Signed-off-by: miurahr <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2025-02-22 09:58:59 +09:00
committed by GitHub
parent 5d699b9ebf
commit 39ae4946a6

View File

@@ -10,8 +10,8 @@ on:
- v*
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
build:
name: Build package
runs-on: ubuntu-22.04
steps:
- name: Checkout 🛎️
@@ -30,6 +30,23 @@ jobs:
run: python -m build ./
- name: twine check
run: python -m twine check dist/*
- name: upload dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
publish:
name: publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-22.04
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish distribution 📦 to Test PyPI when releases branch
if: ${{ startsWith(github.event.ref, 'refs/heads/releases') }}
uses: pypa/gh-action-pypi-publish@release/v1
@@ -39,5 +56,3 @@ jobs:
- name: Publish distribution 📦 to PyPI
if: ${{ startsWith(github.event.ref, 'refs/tags') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}