Skip to content

Commit 523e148

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

File tree

1 file changed

+76
-6
lines changed

1 file changed

+76
-6
lines changed

.github/workflows/pipeline.yml

Lines changed: 76 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,91 @@ 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+
- name: Setup Git
134+
run: |
135+
git config --global core.autocrlf false
136+
git config --global core.eol lf
137+
- name: Checkout sources
138+
uses: actions/checkout@v4
139+
- name: Setup Python
140+
uses: actions/setup-python@v5
141+
- name: Build sdist
142+
run: |
143+
pip install -U setuptools
144+
python setup.py sdist
145+
- name: Upload sdist
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: python-sdist
149+
path: |
150+
./dist/*.tar.gz
151+
if-no-files-found: error
152+
retention-days: 7
153+
154+
build_wheel:
155+
needs:
156+
- tests
157+
- asan
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
include:
162+
- runs-on: ubuntu-latest
163+
platform: linux
164+
arch: manylinux_x86_64
165+
- runs-on: windows-latest
166+
platform: windows
167+
arch: win_amd64
168+
- runs-on: macos-latest
169+
platform: macos
170+
arch: macosx_arm64
171+
172+
steps:
173+
- name: Setup Git
174+
run: |
175+
git config --global core.autocrlf false
176+
git config --global core.eol lf
177+
- name: Checkout sources
178+
uses: actions/checkout@v4
179+
- name: Setup Python
180+
uses: actions/setup-python@v5
181+
- name: Install cibuildwheel
182+
run: |
183+
python -m pip install cibuildwheel==3.1.4
184+
- name: Build wheels
185+
env:
186+
CIBW_PLATFORM: ${{ matrix.platform }}
187+
CIBW_BUILD: "cp3*-${{ matrix.arch }}"
188+
CIBW_SKIP: "cp3?t-* cp3??t-*"
189+
run: |
190+
python -m cibuildwheel --output-dir wheelhouse
191+
- name: Upload wheels
192+
uses: actions/upload-artifact@v4
193+
with:
194+
name: python-wheel-${{ matrix.platform }}-${{ matrix.arch }}-${{ strategy.job-index }}
195+
path: |
196+
./wheelhouse/*.whl
197+
if-no-files-found: error
198+
retention-days: 7
199+
132200
release:
133201
if: ${{ startsWith(github.ref, 'refs/tags/v') || inputs.force_release }}
134202
needs:
135203
- tests
136204
- asan
205+
- build_sdist
206+
- build_wheel
137207
runs-on: ubuntu-latest
138208
steps:
139209
- name: Downloads wheels
140210
uses: actions/download-artifact@v4
141211
with:
142-
pattern: package-*
212+
pattern: python-*
143213
path: package
144214
merge-multiple: true
145215
- name: Setup Python

0 commit comments

Comments
 (0)