77 branches : [ manylinux, build-all ]
88 workflow_dispatch :
99
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ cancel-in-progress : true
13+
1014jobs :
1115 build-manylinux :
1216 name : Build manylinux wheels
1620
1721 steps :
1822 - uses : actions/checkout@v4
23+ with :
24+ submodules : recursive
25+
26+ - name : Cache Cubism SDK
27+ uses : actions/cache@v4
28+ with :
29+ path : |
30+ Live2D/V3/Core
31+ Live2D/V3/Framework
32+ key : csmsdk-${{ hashFiles('setup.py') }}
1933
2034 - name : Build wheels in manylinux container
2135 run : |
@@ -32,23 +46,26 @@ jobs:
3246 # clear stale cmake cache
3347 rm -rf build/
3448
35- # Install cmake once (use cp310 as bootstrap)
36- /opt/python/cp310-cp310 /bin/pip install cmake
37- export PATH="/opt/python/cp310-cp310 /bin:$PATH"
49+ # Install cmake once
50+ /opt/python/cp311-cp311 /bin/pip install cmake
51+ export PATH="/opt/python/cp311-cp311 /bin:$PATH"
3852
39- for ver in 10 11 12 13 14; do
40- PYBIN="/opt/python/cp3${ver}-cp3${ver}/bin"
41- [ -x "$PYBIN/python" ] || continue
42- echo "=== Building with $PYBIN/python ==="
43- "$PYBIN/pip" install "setuptools<82" wheel
44- "$PYBIN/python" setup.py bdist_wheel
45- done
53+ # Stable-ABI build: one cp311-abi3 wheel covers Python >= 3.11
54+ PYBIN=/opt/python/cp311-cp311/bin
55+ "$PYBIN/pip" install -c /work/.github/constraints.txt setuptools wheel
56+ "$PYBIN/python" setup.py bdist_wheel
4657
47- # Tag wheels as manylinux (repair then strip invalid PEP 639 fields)
58+ # Tag wheels as manylinux
4859 for whl in dist/*.whl; do
4960 auditwheel repair "$whl" -w dist/ || true
5061 done
5162
63+ # Verify: metadata check + install + import with the building interpreter
64+ "$PYBIN/pip" install twine
65+ "$PYBIN/python" -m twine check dist/*.whl
66+ "$PYBIN/pip" install --force-reinstall dist/*.whl
67+ "$PYBIN/python" -c "import live2d.v2cpp, live2d.v3"
68+
5269 # Fix file ownership for host
5370 chown -R $(stat -c "%u:%g" /work) /work/dist /work/build
5471
@@ -62,15 +79,23 @@ jobs:
6279 '
6380
6481 - name : Upload wheels to release
82+ if : startsWith(github.ref, 'refs/tags/v')
6583 uses : softprops/action-gh-release@v2
6684 with :
6785 files : |
6886 dist/*.whl
6987
70- # - name: Publish to PyPI
71- # env:
72- # TWINE_USERNAME: __token__
73- # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
74- # run: |
75- # python -m pip install twine
76- # twine upload dist/*.whl --skip-existing
88+ - name : Build sdist
89+ if : startsWith(github.ref, 'refs/tags/v')
90+ run : |
91+ python -m pip install -c .github/constraints.txt setuptools wheel
92+ python setup.py sdist
93+
94+ - name : Publish sdist to PyPI
95+ if : startsWith(github.ref, 'refs/tags/v')
96+ env :
97+ TWINE_USERNAME : __token__
98+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
99+ run : |
100+ python -m pip install twine
101+ twine upload dist/*.tar.gz --skip-existing
0 commit comments