11name : Publish to PyPI
22
3- on :
4- push :
5- branches :
6- - main
3+ on : [push]
74
85jobs :
96 build :
@@ -16,72 +13,47 @@ jobs:
1613 - uses : actions/checkout@v4
1714
1815 - uses : actions/setup-python@v5
16+ with :
17+ python-version : 3.11
1918
2019 - name : Install build tools
21- run : python -m pip install cibuildwheel
20+ run : |
21+ python -m pip install cibuildwheel cython
2222
2323 - name : Build wheel with cibuildwheel
2424 env :
2525 CIBW_BUILD : " cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
26+ CIBW_ARCHS : " auto"
27+ CIBW_JOBS : 4
2628 CIBW_BEFORE_BUILD : pip install cffi
2729 run : python -m cibuildwheel --output-dir wheelhouse
2830
29- - name : Upload wheels
31+ - name : Upload wheelhouse
3032 uses : actions/upload-artifact@v4
3133 with :
32- name : wheels-${{ matrix.os }}
34+ name : wheelhouse
3335 path : wheelhouse/
3436
35- build-dist-artifacts :
37+ publish :
3638 runs-on : ubuntu-latest
3739
3840 steps :
3941 - uses : actions/checkout@v4
4042
4143 - uses : actions/setup-python@v5
44+ with :
45+ python-version : 3.11
4246
4347 - name : Install build tools
44- run : pip install build twine wheel cython
48+ run : |
49+ python -m pip install build cython twine wheel
50+ pip install -U packaging
4551
4652 - name : Compile and Build package
47- run : python setup.py sdist bdist_wheel
53+ run : python setup.py sdist --dist-dir dist/
4854
4955 - name : Upload dist
5056 uses : actions/upload-artifact@v4
5157 with :
5258 name : dist
5359 path : dist/
54-
55- publish :
56- needs :
57- - build
58- - build-dist-artifacts
59- runs-on : ubuntu-latest
60-
61- steps :
62- - name : Download wheels
63- uses : actions/download-artifact@v4
64- with :
65- name : wheels-ubuntu-latest
66-
67- - name : Download wheels
68- uses : actions/download-artifact@v4
69- with :
70- name : wheels-windows-latest
71-
72- - name : Download wheels
73- uses : actions/download-artifact@v4
74- with :
75- name : wheels-macos-latest
76-
77- - name : Download dist
78- uses : actions/download-artifact@v4
79- with :
80- name : dist
81-
82- - name : Compile and Build package
83- run : |
84- mkdir -p dist
85- for f in *; do
86- [ "$f" != "dist" ] && mv "$f" dist/
87- done
0 commit comments