Don't use too new avs+ headers #25
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: Build | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| build-non-windows-wheel: | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: linux_x86_64 | |
| runs-on: ubuntu-latest | |
| - arch: linux_aarch64 | |
| runs-on: ubuntu-24.04-arm | |
| - arch: macosx_x86_64 | |
| runs-on: macos-15-intel | |
| - arch: macosx_arm64 | |
| runs-on: macos-15 | |
| fail-fast: false | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: pypa/cibuildwheel@v3.4.0 | |
| env: | |
| CIBW_BUILD: cp312-* | |
| CIBW_SKIP: cp312-musllinux* | |
| CIBW_CONFIG_SETTINGS: setup-args="-Db_lto=true" | |
| CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=15 | |
| CIBW_BEFORE_ALL_LINUX: > | |
| dnf -y install libjpeg-turbo-devel libjxl-devel libtiff-devel libxml2-devel meson nasm opus-devel vulkan-loader-devel xxhash-devel && | |
| git clone https://code.videolan.org/videolan/dav1d.git --depth 1 && | |
| cd dav1d && | |
| meson setup build -Dprefix=/usr -Denable_tools=false -Denable_tests=false && | |
| meson compile -C build && | |
| meson install -C build && | |
| cd .. && | |
| rm -rf dav1d && | |
| git clone https://github.com/mm2/Little-CMS.git --depth 1 && | |
| cd Little-CMS && | |
| meson setup build -Dprefix=/usr -Dtests=disabled && | |
| meson compile -C build && | |
| meson install -C build && | |
| cd .. && | |
| rm -rf Little-CMS && | |
| git clone https://git.ffmpeg.org/ffmpeg.git --branch n8.1 --depth 1 && | |
| cd ffmpeg && | |
| ./configure --enable-gpl --enable-version3 --disable-programs --disable-doc --disable-avdevice --disable-swresample --disable-swscale --disable-avfilter --disable-encoders --disable-muxers --enable-lcms2 --enable-libdav1d --enable-libjxl --enable-libopus --enable-libxml2 --enable-pic --disable-debug && | |
| make -j$(nproc) && | |
| make install -j$(nproc) && | |
| cd .. && | |
| rm -rf ffmpeg | |
| CIBW_BEFORE_ALL_MACOS: > | |
| brew install dav1d jpeg-xl libxml2 little-cms2 nasm opus vulkan-loader xxhash && | |
| git clone https://git.ffmpeg.org/ffmpeg.git --branch n8.1 --depth 1 && | |
| cd ffmpeg && | |
| ./configure --enable-gpl --enable-version3 --disable-programs --disable-doc --disable-avdevice --disable-swresample --disable-swscale --disable-avfilter --disable-encoders --disable-muxers --enable-lcms2 --enable-libdav1d --enable-libjxl --enable-libopus --enable-libxml2 --enable-pic --disable-debug && | |
| make -j3 && | |
| sudo make install -j3 && | |
| cd .. && | |
| rm -rf ffmpeg | |
| with: | |
| output-dir: dist | |
| - name: Fix tag | |
| run: | | |
| cd dist | |
| for whl in *.whl; do | |
| pipx run wheel tags --remove --python-tag py3 --abi-tag none $whl | |
| done | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: bestsource-${{ matrix.arch }} | |
| path: dist | |
| build-windows-wheel: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: CLANG64 | |
| update: true | |
| install: >- | |
| mingw-w64-clang-x86_64-autotools | |
| mingw-w64-clang-x86_64-cmake | |
| mingw-w64-clang-x86_64-dav1d | |
| mingw-w64-clang-x86_64-git | |
| mingw-w64-clang-x86_64-lcms2 | |
| mingw-w64-clang-x86_64-libjxl | |
| mingw-w64-clang-x86_64-libxml2 | |
| mingw-w64-clang-x86_64-nasm | |
| mingw-w64-clang-x86_64-ninja | |
| mingw-w64-clang-x86_64-opus | |
| mingw-w64-clang-x86_64-python-build | |
| mingw-w64-clang-x86_64-python-wheel | |
| mingw-w64-clang-x86_64-toolchain | |
| mingw-w64-clang-x86_64-vulkan-headers | |
| mingw-w64-clang-x86_64-xxhash | |
| - name: Install davs2 | |
| run: | | |
| git clone https://github.com/pkuvcl/davs2.git --depth 1 | |
| pushd davs2/build/linux | |
| CC=clang++ ./configure --prefix=/clang64 --disable-cli --enable-pic | |
| make install -j$(nproc) | |
| popd | |
| rm -rf davs2 | |
| - name: Install nv-codec-headers | |
| run: | | |
| git clone https://github.com/FFmpeg/nv-codec-headers.git --depth 1 | |
| pushd nv-codec-headers | |
| make install -j$(nproc) PREFIX=/clang64 | |
| popd | |
| rm -rf nv-codec-headers | |
| - name: Install uavs3d | |
| run: | | |
| git clone https://github.com/uavs3/uavs3d.git --depth 1 | |
| pushd uavs3d | |
| cmake -S . -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -DCOMPILE_10BIT=1 --install-prefix /clang64 | |
| ninja -C build install | |
| popd | |
| rm -rf uavs3d | |
| - name: Install XEVD | |
| run: | | |
| git clone https://github.com/mpeg5/xevd.git | |
| pushd xevd | |
| cmake -S . -B build --install-prefix /clang64 | |
| ninja -C build install | |
| popd | |
| rm -rf xevd | |
| mv /clang64/lib/xevd/libxevd.a /clang64/lib | |
| - name: Install FFmpeg | |
| run: | | |
| git clone https://git.ffmpeg.org/ffmpeg.git --branch n8.1 --depth 1 | |
| pushd ffmpeg | |
| ./configure --prefix=/clang64 --enable-gpl --enable-version3 --disable-programs --disable-doc --disable-avdevice --disable-swresample --disable-swscale --disable-avfilter --disable-encoders --disable-muxers --enable-lcms2 --enable-libdav1d --enable-libdavs2 --enable-libjxl --enable-libopus --enable-libuavs3d --enable-libxevd --enable-libxml2 --disable-nvenc --cc=clang --cxx=clang++ --pkg-config-flags=--static --enable-pic --disable-debug | |
| make install -j$(nproc) | |
| popd | |
| rm -rf ffmpeg | |
| - name: Build | |
| run: | | |
| python -m build -Csetup-args="-Dprefer_static=true" -Csetup-args="-Db_lto=true" -Csetup-args="-Dcpp_link_args=-static" | |
| - name: Fix tag | |
| run: | | |
| cd dist | |
| for whl in *.whl; do | |
| wheel tags --remove --python-tag py3 --abi-tag none --platform-tag win_amd64 $whl | |
| done | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: bestsource-sdist | |
| path: dist/*.tar.gz | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: bestsource-win_amd64 | |
| path: dist/*.whl | |
| publish: | |
| permissions: | |
| id-token: write | |
| needs: [build-non-windows-wheel, build-windows-wheel] | |
| if: ${{ startsWith(github.ref, 'refs/tags/R') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |