-
Notifications
You must be signed in to change notification settings - Fork 282
85 lines (83 loc) · 2.51 KB
/
build.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
---
# Outstanding TODOs:
# - Auto PyPI upload?
# - Build sdist here too while we're at it?
# - Don't run this on every push ('on' param)
name: Build wheels
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
manylinux_wheels:
name: Python ${{ matrix.platform }} wheels(${{ matrix.pyver }})
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- manylinux_2_28_x86_64
- manylinux_2_28_aarch64
pyver: ['cp310-cp310', 'cp311-cp311', 'cp312-cp312']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
if: matrix.platform == 'manylinux_2_28_aarch64'
id: qemu
uses: docker/setup-qemu-action@v3
- name: Pull Docker image
run: |
DOCKER_IMAGE="quay.io/pypa/${{ matrix.platform }}"
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> $GITHUB_ENV
docker image pull "$DOCKER_IMAGE"
- name: Build manylinux wheels
run: |
docker container run \
--rm \
-e PLAT=${{ matrix.platform }} \
-e PYTHON_TAGS=${{ matrix.pyver }} \
-v "$(pwd):/io" \
"$DOCKER_IMAGE" \
/io/build_scripts/wheels/manylinux.sh
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.platform }}-${{ matrix.pyver }}
path: dist/*.whl
macosx_wheels:
name: Python ${{ matrix.python_version }} MacOS wheels
# Note: the container MacOS version may differ from the SDK
# used to build Python there. It is the latter that determines
# the wheel's platform tag.
# https://github.com/actions/virtual-environments/issues/696
runs-on: macos-13
strategy:
matrix:
python_version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Build MacOS wheels
run: './build_scripts/wheels/macos.sh'
- uses: actions/upload-artifact@v4
with:
name: dist-macos-py${{ matrix.python_version }}
path: dist/*.whl
merge:
name: Merge artifacts
runs-on: ubuntu-latest
needs:
- manylinux_wheels
- macosx_wheels
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: dist