v18.0.0 #1393
Workflow file for this run
This file contains hidden or 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: tests | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| package-source: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Build source package | |
| run: | | |
| pip install -U cython setuptools | |
| python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor | |
| PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist | |
| - name: Upload source package | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-source | |
| path: dist/ | |
| package-wheel: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-14 | |
| arch: arm64 | |
| - os: macos-15-intel | |
| arch: x86_64 | |
| - os: ubuntu-24.04-arm | |
| arch: aarch64 | |
| - os: ubuntu-24.04 | |
| arch: x86_64 | |
| - os: windows-latest | |
| arch: AMD64 | |
| - os: windows-11-arm | |
| arch: ARM64 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Set Minimum MacOS Target | |
| if: runner.os == 'macOS' | |
| run: | | |
| if [ "${{ matrix.arch }}" = "x86_64" ]; then | |
| echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV | |
| else | |
| echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV | |
| fi | |
| - name: Build wheels | |
| env: | |
| CIBW_ARCHS: ${{ matrix.arch }} | |
| CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor | |
| CIBW_BEFORE_BUILD_MACOS: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor | |
| CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py --config-file scripts\ffmpeg-latest.json C:\cibw\vendor | |
| CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig | |
| CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names | |
| CIBW_ENVIRONMENT_WINDOWS: INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib PYAV_SKIP_TESTS=unicode_filename | |
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel} | |
| CIBW_BUILD: "cp311* cp314t*" | |
| CIBW_TEST_COMMAND: mv {project}/av {project}/av.disabled && python -m pytest {package}/tests && mv {project}/av.disabled {project}/av | |
| CIBW_TEST_REQUIRES: pytest numpy | |
| run: | | |
| pip install cibuildwheel delvewheel | |
| cibuildwheel --output-dir dist | |
| shell: bash | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-${{ matrix.os }}-${{ matrix.arch }} | |
| path: dist/ | |
| # armv7l (32-bit ARM) is cross-compiled with zig on a native x86_64 runner | |
| # instead of emulated with QEMU. cibuildwheel cannot cross-compile, so this | |
| # target uses its own driver (scripts/build-armv7l-cross.sh). | |
| package-wheel-armv7l: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up host Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up host Python 3.14t | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14t" | |
| - name: Install build tooling | |
| run: | | |
| for py in python3.11 python3.14t; do | |
| $py -m pip install -U "cython>=3.1.0,<4" "setuptools>=77.0" wheel | |
| done | |
| # patchelf 0.18 (ubuntu-24.04's system version) corrupts ELF files | |
| # with large p_align; pin <0.18 for auditwheel to use. | |
| python3.11 -m pip install -U ziglang auditwheel 'patchelf<0.18' | |
| - name: Cross-compile armv7l wheels with zig | |
| env: | |
| HOST_PY311: python3.11 | |
| HOST_PY314T: python3.14t | |
| TOOLS_PY: python3.11 | |
| run: bash scripts/build-armv7l-cross.sh | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-armv7l | |
| path: dist/ | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [package-source, package-wheel, package-wheel-armv7l] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| merge-multiple: true | |
| path: dist/ | |
| - name: Publish to GitHub | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to PyPI | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} |