11name : Build
22
3- on : [workflow_dispatch]
4-
5- permissions :
6- attestations : write
7- contents : read
8- id-token : write
9-
10- env :
11- LIBPLACEBO_TAG : v7.360.1
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ workflow_dispatch :
129
1310jobs :
14- build-linux :
15- runs-on : ubuntu-24.04
11+ build-non-windows-wheel :
12+ strategy :
13+ matrix :
14+ include :
15+ - arch : linux_x86_64
16+ runs-on : ubuntu-latest
17+ - arch : linux_aarch64
18+ runs-on : ubuntu-24.04-arm
19+ - arch : macosx_x86_64
20+ runs-on : macos-15-intel
21+ - arch : macosx_arm64
22+ runs-on : macos-15
23+ fail-fast : false
24+
25+ runs-on : ${{ matrix.runs-on }}
26+
1627 steps :
17- - name : Checkout code
18- uses : actions/checkout@v6.0.2
28+ - uses : actions/checkout@v6
1929 with :
2030 submodules : recursive
2131
22- - name : Setup Python
23- uses : actions/setup-python@v6.2.0
32+ - uses : pypa/cibuildwheel@v3.4.1
2433 with :
25- python-version : " 3.14.3"
26- - name : Install uv
27- uses : astral-sh/setup-uv@v7.6.0
28- - name : Install Python dependencies
29- run : |
30- uv tool install meson
31- uv tool install ninja
34+ output-dir : dist
35+ extras : uv
3236
33- - name : Install APT dependencies
37+ - name : Fix tag
3438 run : |
35- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
36- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
37-
38- wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
39- sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
39+ cd dist
40+ for whl in *.whl; do
41+ pipx run wheel tags --remove --python-tag py3 --abi-tag none $whl
42+ done
4043
41- sudo apt update
42- sudo apt install -y cmake glslang-dev shaderc vulkan-headers
43-
44- - name : Checkout SPIRV
45- uses : actions/checkout@v6.0.2
44+ - uses : actions/upload-artifact@v7
4645 with :
47- repository : KhronosGroup/SPIRV-Cross
48- ref : sdk-1.3.236.0
49- path : temp/SPIRV-Cross
50- - name : Install SPIRV
51- working-directory : ./temp/SPIRV-Cross
52- run : |
53- cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
54- -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF \
55- -DSPIRV_CROSS_ENABLE_TESTS=OFF ..
56- ninja -Cbuild
57- sudo $(which ninja) -Cbuild install
58-
59- - name : Checkout VapourSynth
60- uses : actions/checkout@v6.0.2
61- with :
62- repository : vapoursynth/vapoursynth
63- ref : R68
64- path : vapoursynth
65- - name : Install VapourSynth
66- run : |
67- git clone https://bitbucket.org/the-sekrit-twc/zimg.git --depth 1 --recurse-submodules --shallow-submodules
68- pushd zimg
69- ./autogen.sh
70- ./configure --prefix=/usr
71- sudo make install -j$(nproc)
72- popd
73-
74- pushd vapoursynth
75- ./autogen.sh
76- ./configure --prefix=/usr --disable-python-module --disable-vsscript
77- sudo make install -j$(nproc)
78-
79- - name : Setup libplacebo subproject
80- uses : actions/checkout@v6
81- with :
82- repository : haasn/libplacebo
83- ref : ${{ env.LIBPLACEBO_TAG }}
84- path : ' subprojects/libplacebo'
85- submodules : recursive
86-
87- - name : Build vs-placebo
88- run : |
89- meson setup build --buildtype release -Dlibplacebo:demos=false -Dlibplacebo:glslang=enabled
90- meson compile -vC build
46+ name : vs-placebo-${{ matrix.arch }}
47+ path : dist
9148
92- build-windows :
49+ build-windows-wheel :
9350 runs-on : windows-latest
9451 defaults :
9552 run :
@@ -100,47 +57,68 @@ jobs:
10057 with :
10158 submodules : recursive
10259 - name : Setup MSYS2
103- uses : msys2/setup-msys2@v2.27.0
60+ uses : msys2/setup-msys2@v2
10461 with :
10562 msystem : UCRT64
63+ update : true
10664 install : >-
10765 base-devel
66+ mingw-w64-ucrt-x86_64-git
10867 mingw-w64-ucrt-x86_64-jq
10968 mingw-w64-ucrt-x86_64-gcc
110- mingw-w64-ucrt-x86_64-pkg-config
69+ mingw-w64-ucrt-x86_64-python-build
70+ mingw-w64-ucrt-x86_64-pkgconf
11171 mingw-w64-ucrt-x86_64-vapoursynth
11272 mingw-w64-ucrt-x86_64-meson
11373 mingw-w64-ucrt-x86_64-ninja
11474 mingw-w64-ucrt-x86_64-spirv-tools
11575 mingw-w64-ucrt-x86_64-spirv-cross
116- mingw-w64-ucrt-x86_64-vulkan
11776 mingw-w64-ucrt-x86_64-vulkan-headers
11877 mingw-w64-ucrt-x86_64-vulkan-loader
11978 mingw-w64-ucrt-x86_64-libdovi
12079 mingw-w64-ucrt-x86_64-lcms2
12180 mingw-w64-ucrt-x86_64-shaderc
122-
123- - name : Setup libplacebo subproject
124- uses : actions/checkout@v6
125- with :
126- repository : haasn/libplacebo
127- ref : ${{ env.LIBPLACEBO_TAG }}
128- path : ' subprojects/libplacebo'
129- submodules : recursive
81+ mingw-w64-ucrt-x86_64-uv
13082
13183 - name : Build vs-placebo
13284 run : |
133- meson setup build --buildtype release --prefer-static --default-library=static -Dcpp_link_args='-static' -Dlibplacebo:demos=false -Dlibplacebo:glslang=enabled
134- meson compile -vC build
135- - name : Attest build provenance
136- uses : actions/attest-build-provenance@v4.1.0
137- with :
138- subject-path : build/libvs_placebo.dll
139- - name : Export version
85+ : # FIXME: uv does not want to work with subprojects
86+ python -m build --wheel -Csetup-args="--default-library=static" \
87+ -Csetup-args="-Dprefer_static=true" \
88+ -Csetup-args="-Dlibplacebo:demos=false" \
89+ -Csetup-args="-Dlibplacebo:glslang=enabled"
90+
91+ - name : Fix tag
14092 run : |
141- echo "ARTIFACT_VERSION=$(meson introspect --projectinfo build | jq -r '.version')" >> $GITHUB_ENV
142- - name : Upload
143- uses : actions/upload-artifact@v7.0.0
93+ cd dist
94+ for whl in *.whl; do
95+ uvx wheel tags --remove --python-tag py3 --abi-tag none --platform-tag win_amd64 $whl
96+ done
97+
98+ - name : Build sdist
99+ run : python -m build --sdist
100+
101+ - uses : actions/upload-artifact@v7
102+ with :
103+ name : vs-placebo-sdist
104+ path : dist/*.tar.gz
105+
106+ - uses : actions/upload-artifact@v7
144107 with :
145- name : vsplacebo-windows-${{ env.ARTIFACT_VERSION }}
146- path : build/libvs_placebo.dll
108+ name : vs-placebo-win_amd64
109+ path : dist/*.whl
110+
111+ publish :
112+ permissions :
113+ id-token : write
114+ needs : [build-non-windows-wheel, build-windows-wheel]
115+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
116+ runs-on : ubuntu-latest
117+
118+ steps :
119+ - uses : actions/download-artifact@v8
120+ with :
121+ path : dist
122+ merge-multiple : true
123+
124+ - uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments