-
Notifications
You must be signed in to change notification settings - Fork 132
191 lines (163 loc) · 5.13 KB
/
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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: wheels
on:
push:
branches: [master]
pull_request:
branches: [master]
types:
# Opened, synchronize, and reopened are the default types
# We add ready_for_review to additionally trigger when converting from draft to non-draft
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- opened
- synchronize
- reopened
- ready_for_review
release:
types:
- published
jobs:
make_sdist:
name: "SDist: ${{ matrix.os }}"
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/[email protected]
- name: Make sdist
run: |
python --version
pipx --version
pipx run build --sdist
- name: Install from sdist
run: |
pip install --upgrade pip setuptools wheel
pip install pytest
cp dist/h3-*.tar.gz h3.tar.gz
pip install h3.tar.gz[all]
- name: Test sdist
run: pytest --cov=h3 --full-trace
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v3
with:
path: ./dist
make_cibw_v1_wheels:
name: "cibuildwheel v1: ${{ matrix.name }}"
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Only build for platforms that cibw v2 doesn't support
include:
- os: macos-latest
build: "cp27-macosx_x86_64"
name: macOS Intel
- os: ubuntu-20.04
build: "cp27-manylinux_x86_64"
name: Linux Intel 64-bit
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
## Build
- uses: pypa/[email protected]
env:
CIBW_TEST_REQUIRES: pytest numpy
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ARCHS_LINUX: auto aarch64
CIBW_BUILD: ${{ matrix.build }}
- name: Check with Twine
run: |
pipx run twine check wheelhouse/*
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
make_cibw_v2_wheels:
name: "cibuildwheel v2: ${{ matrix.name }}"
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
build: "cp*-macosx*"
name: macOS
- os: windows-latest
build: "cp3*-win_amd64"
name: Windows 64-bit
- os: ubuntu-20.04
build: "cp*-manylinux_x86_64"
name: Linux Intel glibc 64-bit
- os: ubuntu-20.04
build: "cp*-musllinux_x86_64"
name: Linux Intel musl 64-bit
- os: ubuntu-20.04
build: "cp36-manylinux_aarch64"
name: Linux Aarch64 3.6
- os: ubuntu-20.04
build: "cp37-manylinux_aarch64"
name: Linux Aarch64 3.7
- os: ubuntu-20.04
build: "cp38-manylinux_aarch64"
name: Linux Aarch64 3.8
- os: ubuntu-20.04
build: "cp39-manylinux_aarch64"
name: Linux Aarch64 3.9
- os: ubuntu-20.04
build: "cp310-manylinux_aarch64"
name: Linux Aarch64 3.10
- os: ubuntu-20.04
build: "cp311-manylinux_aarch64"
name: Linux Aarch64 3.11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
## Setup Env
- uses: ilammy/[email protected]
if: runner.os == 'Windows'
- name: Set Windows variables
if: runner.os == 'Windows'
shell: bash
run: |
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/[email protected]
with:
platforms: aarch64
## Build
- uses: pypa/[email protected]
env:
CIBW_TEST_REQUIRES: pytest numpy
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: ${{ matrix.skip }}
- name: Check with Twine
run: |
pipx run twine check wheelhouse/*
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
upload_all:
needs: [make_sdist, make_cibw_v1_wheels, make_cibw_v2_wheels]
runs-on: ubuntu-20.04
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}