Merge pull request #7616 from radarhere/pypi

Added trusted PyPI publishing
This commit is contained in:
Andrew Murray 2023-12-27 09:37:14 +11:00 committed by GitHub
commit 265ee32457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,9 +75,9 @@ jobs:
CIBW_TEST_SKIP: "*-macosx_arm64" CIBW_TEST_SKIP: "*-macosx_arm64"
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: dist name: dist-${{ matrix.os }}-${{ matrix.archs }}${{ matrix.manylinux && format('-{0}', matrix.manylinux) }}
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl
windows: windows:
@ -154,9 +154,9 @@ jobs:
shell: cmd shell: cmd
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: dist name: dist-windows-${{ matrix.arch }}
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl
- name: Upload fribidi.dll - name: Upload fribidi.dll
@ -179,17 +179,26 @@ jobs:
- run: make sdist - run: make sdist
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: dist name: dist-sdist
path: dist/*.tar.gz path: dist/*.tar.gz
success: pypi-publish:
permissions: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
contents: none
needs: [build, windows, sdist] needs: [build, windows, sdist]
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Wheels Successful name: Upload release to PyPI
environment:
name: release-pypi
url: https://pypi.org/p/Pillow
permissions:
id-token: write
steps: steps:
- name: Success - uses: actions/download-artifact@v4
run: echo Wheels Successful with:
pattern: dist-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1