Skip to content

Migrate to Python wheel packaging #43

Migrate to Python wheel packaging

Migrate to Python wheel packaging #43

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-26]
llvm: [20, 21, 22]
name: Build os=${{ matrix.os }} llvm=${{ matrix.llvm }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Set up Nix cache
uses: cachix/cachix-action@v17
with:
name: vs-nix-overlay
- name: Build
run: nix develop -L .#llvm_${{ matrix.llvm }} -c uv build --wheel --out-dir dist_llvm${{ matrix.llvm }}
- name: Upload
uses: actions/upload-artifact@v7.0.1
if: ${{ matrix.llvm == 22 }}
with:
path: |
dist/*.whl
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- uses: msys2/setup-msys2@v2.31.0
with:
msystem: CLANG64
update: true
pacboy: >-
toolchain:p
meson:p
ninja:p
pkgconf:p
libxml2:p
7zip:p
uv:p
- name: Configure and build
env:
MESON_ARGS: >-
--buildtype release
--prefer-static
--default-library=static
-Dcpp_link_args=-static
run: uv build --wheel --verbose
# HACK: only necessary for `libzstd.dll` for LLVM 17 and above.
- name: Repair Wheel (Copy dependencies)
run: |
WHEEL_FILE=$(ls dist/*.whl | head -n 1)
DLL_PATH=$(uvx delvewheel show "$WHEEL_FILE" --add-path /clang64/bin --include libzstd.dll | grep -oP '\(\K[^)]+')
if [ -z "$DLL_PATH" ]; then
echo "Error: Could not find libzstd.dll path via delvewheel."
exit 1
fi
echo "Found DLL at: $DLL_PATH"
echo "Targeting wheel: $WHEEL_FILE"
mkdir -p wheel_contents
7z x "$WHEEL_FILE" -owheel_contents
TARGET_DIR="wheel_contents/vapoursynth/plugins/akarin"
if [ -d "$TARGET_DIR" ]; then
cp "$DLL_PATH" "$TARGET_DIR/"
echo "Successfully injected libzstd.dll into $TARGET_DIR"
else
echo "Error: Target directory $TARGET_DIR not found in wheel."
exit 1
fi
rm "$WHEEL_FILE"
cd wheel_contents
7z a -tzip "../$WHEEL_FILE" *
cd ..
rm -rf wheel_contents
echo "Wheel successfully rebuilt without delvewheel init-patch."
- name: Upload
uses: actions/upload-artifact@v7.0.1
with:
path: |
dist/*.whl