different names #490
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wheels | |
on: | |
push: | |
permissions: | |
contents: read | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
windows: | |
name: Windows ${{ matrix.arch }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: x86 | |
cibw_arch: x86 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout extra test images | |
uses: actions/checkout@v4 | |
with: | |
repository: python-pillow/test-images | |
path: Tests\test-images | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Prepare for build | |
run: | | |
choco install nasm --no-progress | |
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH | |
# Install extra test images | |
xcopy /S /Y Tests\test-images\* Tests\images | |
& python.exe -m pip install -r .ci/requirements-cibw.txt | |
# Cannot cross-compile FriBiDi (only used for tests) | |
$FLAGS = ("--no-imagequant", "--architecture=${{ matrix.arch }}") | |
if ('${{ matrix.arch }}' -eq 'ARM64') { $FLAGS += "--no-fribidi" } | |
& python.exe winbuild\build_prepare.py -v @FLAGS | |
shell: pwsh | |
- name: Build wheels | |
run: | | |
setlocal EnableDelayedExpansion | |
for %%f in (winbuild\build\license\*) do ( | |
set x=%%~nf | |
rem Skip FriBiDi license, it is not included in the wheel. | |
set fribidi=!x:~0,7! | |
if NOT !fribidi!==fribidi ( | |
rem Skip imagequant license, it is not included in the wheel. | |
set libimagequant=!x:~0,13! | |
if NOT !libimagequant!==libimagequant ( | |
echo. >> LICENSE | |
echo ===== %%~nf ===== >> LICENSE | |
echo. >> LICENSE | |
type %%f >> LICENSE | |
) | |
) | |
) | |
call winbuild\\build\\build_env.cmd | |
%pythonLocation%\python.exe -m cibuildwheel . --output-dir wheelhouse | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
CIBW_BEFORE_ALL: "{package}\\winbuild\\build\\build_dep_all.cmd" | |
CIBW_CACHE_PATH: "C:\\cibw" | |
CIBW_TEST_SKIP: "*-win_arm64" | |
CIBW_TEST_COMMAND: 'docker run --rm | |
-v {project}:C:\pillow | |
-v C:\cibw:C:\cibw | |
-v %CD%\..\venv-test:%CD%\..\venv-test | |
-e CI -e GITHUB_ACTIONS | |
mcr.microsoft.com/windows/servercore:ltsc2022 | |
powershell C:\pillow\.github\workflows\wheels-test.ps1 %CD%\..\venv-test' | |
shell: cmd | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: ./wheelhouse/*.whl | |
- name: Prepare to upload FriBiDi | |
if: "matrix.arch != 'ARM64'" | |
run: | | |
mkdir fribidi\${{ matrix.arch }} | |
copy winbuild\build\bin\fribidi* fribidi\${{ matrix.arch }} | |
shell: cmd | |
- name: Upload fribidi.dll | |
if: "matrix.arch != 'ARM64'" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fribidi | |
path: fribidi\* | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
cache: pip | |
cache-dependency-path: "Makefile" | |
- run: make sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/*.tar.gz | |
pypi-publish: | |
needs: [windows, sdist] | |
runs-on: ubuntu-latest | |
name: Upload release to PyPI | |
environment: | |
name: pypi | |
url: https://pypi.org/p/Pillow | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Publish to PyPI | |
run: | | |
pwd | |
ls | |
ls dist |