11name : Publish to PyPI
22
3- on :
4- push :
5- branches :
6- - main
3+ on : [push]
74
85jobs :
96 build :
@@ -16,72 +13,46 @@ 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 : python -m pip install cibuildwheel cython setuptools wheel
2221
2322 - name : Build wheel with cibuildwheel
2423 env :
2524 CIBW_BUILD : " cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
25+ CIBW_ARCHS : " auto"
26+ CIBW_JOBS : 4
2627 CIBW_BEFORE_BUILD : pip install cffi
2728 run : python -m cibuildwheel --output-dir wheelhouse
2829
29- - name : Upload wheels
30+ - name : Upload wheelhouse
3031 uses : actions/upload-artifact@v4
3132 with :
32- name : wheels -${{ matrix.os }}
33+ name : wheelhouse -${{matrix.os}}
3334 path : wheelhouse/
3435
35- build-dist-artifacts :
36+ publish :
3637 runs-on : ubuntu-latest
3738
3839 steps :
3940 - uses : actions/checkout@v4
4041
4142 - uses : actions/setup-python@v5
43+ with :
44+ python-version : 3.11
4245
4346 - name : Install build tools
44- run : pip install build twine wheel cython
47+ run : |
48+ python -m pip install build cython twine wheel
49+ pip install -U packaging
4550
4651 - name : Compile and Build package
47- run : python setup.py sdist bdist_wheel
52+ run : python setup.py sdist --dist-dir dist/
4853
4954 - name : Upload dist
5055 uses : actions/upload-artifact@v4
5156 with :
5257 name : dist
5358 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