11name : publish
22
3- on :
4- push :
5- tags :
6- - v*
3+ on : [push, pull_request]
74
85jobs :
9- pypi :
6+ build :
107 runs-on : ubuntu-latest
118
129 steps :
@@ -15,18 +12,80 @@ jobs:
1512 uses : actions/setup-python@v2
1613 with :
1714 python-version : 3.9
15+ - name : Install python dependencies
16+ run : pip install Cython auditwheel
1817 - name : Build a source tarball
1918 run : python setup.py sdist
20- - name : Build wheels
21- uses : RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
22- with :
23- python-versions : ' cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313 cp314-cp314'
24- build-requirements : ' cython'
25- - name : Clean linux_x86_64.whl
26- run : rm dist/*-linux_x86_64.whl
19+ - name : Build Wheel
20+ run : python setup.py bdist_wheel --py-limited-api=cp39
21+ - name : Repair Wheel
22+ run : find dist -name *.whl -print -exec auditwheel repair {} \;
23+ - name : Clean Non Audited Wheel
24+ run : rm -v dist/*-linux_x86_64.whl
2725 - name : Check build result
28- run : ls -lh dist/
26+ run : |
27+ ls -lh dist
28+ find dist -name *.tar.gz -print -exec tar -ztvf {} \;
29+ ls -lh wheelhouse
30+ find wheelhouse -name *.whl -print -exec unzip -l {} \;
31+ - uses : actions/upload-artifact@v4
32+ with :
33+ name : wheel
34+ path : wheelhouse/*.whl
35+ - uses : actions/upload-artifact@v4
36+ with :
37+ name : sdist
38+ path : dist/*.tar.gz
39+
40+ test :
41+ needs : [build]
42+ runs-on : ubuntu-latest
43+ strategy :
44+ matrix :
45+ pyver : ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
46+
47+ steps :
48+ - uses : actions/checkout@v4
49+ with :
50+ # only checkout files for test
51+ sparse-checkout : |
52+ tests
53+ misc/test.sh
54+ - uses : actions/download-artifact@v4
55+ with :
56+ name : wheel
57+ path : wheel
58+ - name : Set up Python
59+ uses : actions/setup-python@v2
60+ with :
61+ python-version : ${{ matrix.pyver }}
62+ - name : Install python dependencies
63+ run : |
64+ pip install gevent
65+ pip install wheel/*.whl
66+ - name : Run test
67+ run : misc/test.sh
68+
69+ pypi :
70+ needs : [build, test]
71+ runs-on : ubuntu-latest
72+
73+ steps :
74+ - uses : actions/download-artifact@v4
75+ with :
76+ name : wheel
77+ path : dist
78+ - uses : actions/download-artifact@v4
79+ with :
80+ name : sdist
81+ path : dist
82+ - name : dump result
83+ run : |
84+ ls -lh dist
85+ find dist -name *.whl -print -exec unzip -l {} \;
86+ find dist -name *.tar.gz -print -exec tar -ztvf {} \;
2987 - name : Publish to PyPI
88+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
3089 uses : pypa/gh-action-pypi-publish@release/v1
3190 with :
3291 skip_existing : true
0 commit comments