Skip to content

Commit

Permalink
ci: use trusted publishers for pypi publishing (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 authored Nov 5, 2024
1 parent f2ae52e commit bf9d58b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
build-publish:
name: Build and publish wheels
runs-on: ubuntu-latest
environment: pypi
strategy:
matrix:
package:
Expand Down Expand Up @@ -67,8 +68,10 @@ jobs:
echo " - event_name: ${{ github.event_name }}"
echo " - ref_type: ${{ github.ref_type }}"
echo " - ref: ${{ github.ref }}"
uvx twine upload --skip-existing --verbose dist/*
env:
TWINE_NON_INTERACTIVE: 1
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH }}
- name: Publish package distributions to PyPI
# This workflow is a trusted publisher on PyPI for this package.
if: ${{ (github.event_name == 'release' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package.dir))) || (github.event_name == 'workflow_dispatch' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package.dir))) }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
skip-existing: true

0 comments on commit bf9d58b

Please sign in to comment.