Skip to content

Commit

Permalink
ci: Update winbuild script, bundle rav1e and libyuv in windows wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Sep 27, 2023
1 parent 27c3e6c commit 72c1617
Show file tree
Hide file tree
Showing 2 changed files with 347 additions and 294 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ jobs:
- name: Install dependencies
id: install
run: |
7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\"
echo "$env:RUNNER_WORKSPACE\nasm-2.14.02" >> $env:GITHUB_PATH
7z x winbuild\depends\nasm-2.16.01-win64.zip "-o$env:RUNNER_WORKSPACE\"
echo "$env:RUNNER_WORKSPACE\nasm-2.16.01" >> $env:GITHUB_PATH
winbuild\depends\gs9533w32.exe /S
echo "C:\Program Files (x86)\gs\gs9.53.3\bin" >> $env:GITHUB_PATH
python -m pip install meson
# make cache key depend on VS version
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" `
| find """catalog_buildVersion""" `
| ForEach-Object { $a = $_.split(" ")[1]; echo "vs=$a" >> $env:GITHUB_OUTPUT }
Expand All @@ -270,7 +270,7 @@ jobs:
- name: Prepare build
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
& python.exe winbuild\build_prepare.py -v --python=$env:pythonLocation --srcdir
& python.exe winbuild\build_prepare.py -v
shell: pwsh

- name: Build dependencies / libjpeg-turbo
Expand All @@ -294,21 +294,28 @@ jobs:
run: python -m pip install meson
shell: cmd

- name: Build dependencies / rav1e
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_rav1e.cmd"

- name: Build dependencies / libavif
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libavif.cmd"

- name: Install dependencies / Pillow
run: "& winbuild\\build\\install_pillow.cmd"

# trim ~150MB x 9
- name: Optimize build cache
if: steps.build-cache.outputs.cache-hit != 'true'
run: rmdir /S /Q winbuild\build\src
shell: cmd

- name: Install dependencies / Pillow
run: |
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe -m pip install -v Pillow"
shell: pwsh

- name: Build pillow-avif-plugin
run: "& winbuild\\build\\build_pillow_avif_plugin.cmd install"
run: |
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe setup.py build_ext install"
shell: pwsh

# failing with PyPy3
Expand Down Expand Up @@ -351,9 +358,8 @@ jobs:
id: wheel
if: "github.event_name == 'push'"
run: |
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo dist=dist-%%a >> %GITHUB_OUTPUT%
winbuild\\build\\build_pillow_avif_plugin.cmd bdist_wheel
shell: cmd
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe -m pip wheel ."
shell: pwsh

- uses: actions/upload-artifact@v3
if: "github.event_name == 'push'"
Expand Down
Loading

0 comments on commit 72c1617

Please sign in to comment.