-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (119 loc) · 4.76 KB
/
cibuildwheels.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Python wheels
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x86_64, aarch64]
exclude:
- os: windows-latest
arch: aarch64
- os: macos-latest
arch: aarch64
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
- name: Install Ninja
id: ninja
uses: turtlesec-no/get-ninja@main
- name: Install MSVC amd64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Update Clang
if: ${{ matrix.os == 'macos-latest' && matrix.arch == 'arm64' }}
run: |
sudo xcode-select -s /Applications/Xcode_15.0.app/Contents/Developer
clang -v
- name: Build wheels (Windows)
if: runner.os == 'Windows'
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: python -m pip install cibuildwheel -U
CIBW_BUILD: 'cp310-win_amd64 cp311-win_amd64 cp312-win_amd64'
CIBW_BEFORE_TEST: python -m pip install --upgrade pip && python -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
cmd /V /C "set BLOSC_TRACE=1 && python -m pytest {project}/tests"
- name: Build wheels (Linux x86_64)
if: ${{ matrix.os != 'windows-latest' && matrix.arch != 'aarch64' && runner.os == 'Linux'}}
uses: pypa/[email protected]
env:
# The build requirements should be installed by the pyproject.toml specs
#CIBW_BEFORE_BUILD: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-build.txt
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=x86_64
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
BLOSC_TRACE=1 python3 -m pytest {project}/tests
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64"
- name: Build wheels (Mac OSX x86_64)
if: ${{ matrix.os != 'windows-latest' && matrix.arch != 'aarch64' && runner.os != 'Linux' }}
uses: pypa/[email protected]
env:
# The build requirements should be installed by the pyproject.toml specs
#CIBW_BEFORE_BUILD: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-build.txt
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=x86_64 DONT_BUILD_EXAMPLES=1
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
BLOSC_TRACE=1 python3 -m pytest {project}/tests
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64"
- name: Build wheels (Ubuntu aarch64)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }}
uses: pypa/[email protected]
env:
# The build requirements should be installed by the pyproject.toml specs
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_ARCHS_LINUX: "aarch64"
- name: Build wheels (Mac OSX arm64)
if: ${{ matrix.os != 'windows-latest' && runner.os != 'Linux' }}
uses: pypa/[email protected]
env:
# The build requirements should be installed by the pyproject.toml specs
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=arm64
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_TEST_SKIP: "*macosx*arm64*" # cibuild does not support testing arm64 on macos
CIBW_ARCHS_MACOS: "arm64"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_pypi:
needs: [ build_wheels ] # last but not least
runs-on: ubuntu-latest
# Only upload wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.blosc_pypi_secret }}