-
Notifications
You must be signed in to change notification settings - Fork 10
63 lines (55 loc) · 1.74 KB
/
build-wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build Wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
include:
- os: macos-latest
arch: arm64
- os: macos-latest
arch: x86_64
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp3{10,11,12}-*
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: ${{ matrix.arch || 'x86_64 arm64' }}
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_WINDOWS: AMD64
# Include dependencies in the wheel
CIBW_BEFORE_BUILD: pip install poetry && poetry install
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=/usr/local/lib delocate-wheel
--require-archs {delocate_archs}
-w {dest_dir}
-v {wheel}
- name: Build source distribution
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: |
pip install build
python -m build --sdist --outdir wheelhouse/
- name: Upload to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: wheelhouse/*