Skip to content

Commit 1e52e1f

Browse files
committed
ci: Setup cibuildwheel for building wheels
1 parent cbd9892 commit 1e52e1f

File tree

1 file changed

+79
-6
lines changed

1 file changed

+79
-6
lines changed

.github/workflows/pipeline.yml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
23-
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]
23+
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9"]
2424
config: [Release]
2525
include:
2626
- os: windows-latest
2727
python-version: "3.13"
2828
config: Debug
2929
exclude:
30-
- os: ubuntu-latest
31-
python-version: "3.8"
3230
- os: ubuntu-latest
3331
python-version: "3.9"
3432
- os: ubuntu-latest
@@ -37,8 +35,6 @@ jobs:
3735
python-version: "3.11"
3836
- os: ubuntu-latest
3937
python-version: "3.12"
40-
- os: macos-latest
41-
python-version: "3.8"
4238
- os: macos-latest
4339
python-version: "3.9"
4440
- os: macos-latest
@@ -129,17 +125,94 @@ jobs:
129125
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
130126
./build/tests/cpp/yaramod_tests
131127
128+
build_sdist:
129+
needs:
130+
- tests
131+
- asan
132+
runs-on: ubuntu-latest
133+
steps:
134+
- name: Setup Git
135+
run: |
136+
git config --global core.autocrlf false
137+
git config --global core.eol lf
138+
- name: Checkout sources
139+
uses: actions/checkout@v4
140+
- name: Setup Python
141+
uses: actions/setup-python@v5
142+
- name: Build sdist
143+
run: |
144+
pip install -U setuptools
145+
python setup.py sdist
146+
- name: Upload sdist
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: python-sdist
150+
path: |
151+
./dist/*.tar.gz
152+
if-no-files-found: error
153+
retention-days: 7
154+
155+
build_wheel:
156+
needs:
157+
- tests
158+
- asan
159+
strategy:
160+
fail-fast: false
161+
matrix:
162+
include:
163+
- os: ubuntu-latest
164+
platform: linux
165+
arch: manylinux_x86_64
166+
- runs-on: windows-latest
167+
platform: windows
168+
arch: win_amd64
169+
- runs-on: macos-latest
170+
platform: macos
171+
arch: macosx_arm64
172+
173+
runs-on: ${{ matrix.runs-on }}
174+
175+
steps:
176+
- name: Setup Git
177+
run: |
178+
git config --global core.autocrlf false
179+
git config --global core.eol lf
180+
- name: Checkout sources
181+
uses: actions/checkout@v4
182+
- name: Setup Python
183+
uses: actions/setup-python@v5
184+
- name: Install cibuildwheel
185+
run: |
186+
python -m pip install cibuildwheel==3.1.4
187+
- name: Build wheels
188+
env:
189+
CIBW_PLATFORM: ${{ matrix.platform }}
190+
CIBW_BUILD: "cp3*-${{ matrix.arch }}"
191+
CIBW_SKIP: "cp3?t-* cp3??t-*"
192+
run: |
193+
python -m cibuildwheel --output-dir wheelhouse
194+
- name: Upload wheels
195+
uses: actions/upload-artifact@v4
196+
with:
197+
name: python-wheel-${{ matrix.platform }}-${{ matrix.arch }}-${{ strategy.job-index }}
198+
path: |
199+
./wheelhouse/*.whl
200+
if-no-files-found: error
201+
retention-days: 7
202+
132203
release:
133204
if: ${{ startsWith(github.ref, 'refs/tags/v') || inputs.force_release }}
134205
needs:
135206
- tests
136207
- asan
208+
- build_sdist
209+
- build_wheel
137210
runs-on: ubuntu-latest
138211
steps:
139212
- name: Downloads wheels
140213
uses: actions/download-artifact@v4
141214
with:
142-
pattern: package-*
215+
pattern: python-*
143216
path: package
144217
merge-multiple: true
145218
- name: Setup Python

0 commit comments

Comments
 (0)