Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added trusted PyPI publishing #7616

Merged
merged 10 commits into from Dec 26, 2023
35 changes: 23 additions & 12 deletions .github/workflows/wheels.yml
Expand Up @@ -75,9 +75,9 @@ jobs:
CIBW_TEST_SKIP: "*-macosx_arm64"
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.os }}-${{ matrix.archs }}${{ matrix.manylinux && format('-{0}', matrix.manylinux) }}
path: ./wheelhouse/*.whl

windows:
Expand Down Expand Up @@ -154,9 +154,9 @@ jobs:
shell: cmd

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.arch }}
radarhere marked this conversation as resolved.
Show resolved Hide resolved
path: ./wheelhouse/*.whl

- name: Upload fribidi.dll
Expand All @@ -179,17 +179,28 @@ jobs:

- run: make sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist-sdist
path: dist/*.tar.gz

success:
permissions:
contents: none
pypi-publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
radarhere marked this conversation as resolved.
Show resolved Hide resolved
needs: [build, windows, sdist]
runs-on: ubuntu-latest
name: Wheels Successful
name: Upload release to PyPI
hugovk marked this conversation as resolved.
Show resolved Hide resolved
environment:
name: release-pypi
url: https://pypi.org/p/Pillow
Comment on lines +192 to +194
Copy link
Member

@hugovk hugovk Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's failing because we don't have an env set-up yet? Shall we try without, and we can always add back later?

Suggested change
environment:
name: release-pypi
url: https://pypi.org/p/Pillow

permissions:
id-token: write
steps:
- name: Success
run: echo Wheels Successful
- uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
radarhere marked this conversation as resolved.
Show resolved Hide resolved
with:
repository-url: https://test.pypi.org/legacy/