@@ -33,142 +33,72 @@ jobs:
3333 name : sdist
3434 path : dist/*.tar.gz
3535
36- Linux :
37- runs-on : ubuntu-latest
38-
36+ build_wheels :
37+ name : Build wheels on ${{ matrix.os }}
3938 strategy :
40- # Allows for matrix sub-jobs to fail without canceling the rest
4139 fail-fast : false
42-
4340 matrix :
44- image :
45- # see
46- # * https://github.com/pypa/manylinux#docker-images
47- # * https://quay.io/organization/pypa
48- # * manylinux1: https://github.com/pypa/manylinux/issues/994#issuecomment-787013983
49- - manylinux2014_x86_64
50- - manylinux2014_i686
51- - manylinux2014_aarch64
52- - manylinux1_x86_64
53- - manylinux1_i686
54- - musllinux_1_1_x86_64
55- - musllinux_1_1_i686
56- - musllinux_1_1_aarch64
57- - musllinux_1_2_armv7l
58- pyversion : ["*"]
59- exclude :
60- - image : manylinux2014_aarch64
61- pyversion : " *"
62- - image : musllinux_1_1_aarch64
63- pyversion : " *"
6441 include :
65- - image : manylinux2014_aarch64
66- pyversion : " cp39*"
67- - image : manylinux2014_aarch64
68- pyversion : " cp310*"
69- - image : manylinux2014_aarch64
70- pyversion : " cp311*"
71- - image : manylinux2014_aarch64
72- pyversion : " cp312*"
73- - image : manylinux2014_aarch64
74- pyversion : " cp313*"
75- - image : musllinux_1_1_aarch64
76- pyversion : " cp39*"
77- - image : musllinux_1_1_aarch64
78- pyversion : " cp310*"
79- - image : musllinux_1_1_aarch64
80- pyversion : " cp311*"
81- - image : musllinux_1_1_aarch64
82- pyversion : " cp312*"
83- - image : musllinux_1_1_aarch64
84- pyversion : " cp313*"
85- steps :
86- - uses : actions/checkout@v4
87-
88- - name : Set up Python
89- uses : actions/setup-python@v5
90- with :
91- python-version : " 3.x"
92-
93- - name : Install dependencies
94- run : python -m pip install .
95-
96- - name : Build Linux wheels
97- run : make sdist wheel_${{ matrix.image }}
98- env : { STATIC_DEPS: true, PYTHON_BUILD_VERSION: "${{ matrix.pyversion }}" }
99-
100- - name : Prepare Python version without asterisk
101- id : cleanup
102- run : |
103- # Assign the matrix.pyversion to a shell variable
104- CLEANED_PYVERSION="${{ matrix.pyversion }}"
105- # Remove '*' from the variable
106- CLEANED_PYVERSION="${CLEANED_PYVERSION//\*/}"
107- # Set the output variable
108- echo "clean_pyversion=$CLEANED_PYVERSION" >> $GITHUB_OUTPUT
109-
110- - name : Upload wheels
111- uses : actions/upload-artifact@v4
112- with :
113- name : wheels-${{ matrix.image }}-${{ steps.cleanup.outputs.clean_pyversion }}
114- path : wheelhouse/*/*-m*linux*.whl # manylinux / musllinux
115- if-no-files-found : ignore
116-
117- non-Linux :
118- strategy :
119- # Allows for matrix sub-jobs to fail without canceling the rest
120- fail-fast : false
121-
122- matrix :
123- os : [macos-latest, windows-2019]
124- python_version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
42+ - os : ubuntu-latest
43+ arch : auto i686 aarch64 armv7l
44+ skip : cp36-* cp37-* cp38-* pp37-* pp38-* pp39-*
45+ - os : windows-latest
46+ arch : AMD64 ARM64
47+ skip : cp36-* cp37-* cp38-* pp37-* pp38-* pp39-*
48+ - os : macos-13
49+ arch : x86_64 arm64 universal2
50+ skip : cp36-* cp37-* cp38-* pp*
51+ - os : macos-14
52+ arch : x86_64 arm64 universal2
53+ skip : cp36-* cp37-* cp38-* pp*
12554
12655 runs-on : ${{ matrix.os }}
127- env : { MACOSX_DEPLOYMENT_TARGET: 10.15 }
12856
12957 steps :
130- - uses : actions/checkout@v4
58+ - uses : actions/checkout@v4
13159
132- - name : Set up Python
133- uses : actions/setup-python@v5
134- with :
135- python-version : ${{ matrix.python_version }}
60+ - uses : actions/setup-python@v5
61+ with :
62+ python-version : ' 3.12'
13663
137- - name : Install MacOS dependencies
138- if : startsWith(matrix.os, 'mac')
139- run : |
140- brew install automake libtool
141- ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
64+ - name : Install cibuildwheel
65+ run : python -m pip install cibuildwheel==2.22.0
14266
143- - name : Build wheels
144- run : make sdist wheel
145- env : { STATIC_DEPS: true }
67+ - name : Set up QEMU
68+ if : runner.os == 'Linux'
69+ uses : docker/setup-qemu-action@v3
70+ with :
71+ platforms : all
14672
147- - name : Upload wheels
148- uses : actions/upload-artifact@v4
149- with :
150- name : wheels-${{ matrix.os }}-${{ matrix.python_version }}
151- path : dist/fasttext_predict-*.whl
152- if-no-files-found : ignore
73+ - name : Build wheels
74+ run : python -m cibuildwheel --output-dir wheelhouse
75+ env :
76+ CIBW_ARCHS_LINUX : ${{ matrix.arch }}
77+ CIBW_SKIP : ${{ matrix.skip }}
78+ CIBW_ENABLE : cpython-freethreading
79+
80+ - uses : actions/upload-artifact@v4
81+ with :
82+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
83+ path : ./wheelhouse/*.whl
15384
15485 release :
15586 name : Release
15687 runs-on : ubuntu-latest
15788 if : startsWith(github.ref, 'refs/tags/')
158- needs : [ sdist, Linux, non-Linux ]
89+ needs : [ sdist, build_wheels ]
15990 steps :
16091 - uses : actions/download-artifact@v4
16192 with :
16293 path : artifacts
16394 - uses : actions/setup-python@v4
16495 with :
165- python-version : 3.9
96+ python-version : ' 3.12 '
16697 - name : Display structure of downloaded files
16798 run : |
16899 ls -R
169100 mkdir dist
170101 mv artifacts/sdist/*.tar.gz dist
171- mv artifacts/*/*/*.whl dist
172102 mv artifacts/*/*.whl dist
173103 - name : Publish to PyPi
174104 env :
0 commit comments