-
-
Notifications
You must be signed in to change notification settings - Fork 29
89 lines (79 loc) · 2.52 KB
/
reusable-cibuildwheel.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
---
name: ♲ 👷 Build wheel 🛞📦
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
dists-artifact-name:
description: Workflow artifact name containing dists
required: true
type: string
cython-tracing:
description: Whether to build Cython modules with line tracing
default: '0'
required: false
type: string
os:
description: VM OS to use, without version suffix
default: ubuntu
required: false
type: string
qemu:
description: Emulated QEMU architecture
default: ''
required: false
type: string
source-tarball-name:
description: Sdist filename wildcard
required: true
type: string
wheel-tags-to-skip:
description: Wheel tags to skip building
default: ''
required: false
type: string
env:
FORCE_COLOR: "1" # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
jobs:
build-wheel:
name: Build wheels on ${{ inputs.os }} ${{ inputs.qemu }}
runs-on: ${{ inputs.os }}
timeout-minutes: ${{ inputs.qemu && 60 || 20 }}
steps:
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v1
with:
source-tarball-name: ${{ inputs.source-tarball-name }}
workflow-artifact-name: ${{ inputs.dists-artifact-name }}
- name: Set up QEMU
if: inputs.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
id: qemu
- name: Prepare emulation
if: inputs.qemu
run: |
# Build emulated architectures only if QEMU is set,
# use default "auto" otherwise
echo "CIBW_ARCHS_LINUX=${{ inputs.qemu }}" >> "${GITHUB_ENV}"
shell: bash
# - name: Skip building some wheel tags
# if: inputs.wheel-tags-to-skip
# run: |
# echo "CIBW_SKIP=${{ inputs.wheel-tags-to-skip }}" >> "${GITHUB_ENV}"
# shell: bash
- name: Build wheels
uses: pypa/[email protected]
env:
# CIBW_ARCHS_MACOS: all x86_64 arm64 universal2
CIBW_ARCHS_MACOS: native
CIBW_CONFIG_SETTINGS: >- # Cython line tracing for coverage collection
with-cython-tracing=${{ inputs.cython-tracing }}
- name: Upload built artifacts for testing and publishing
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.dists-artifact-name }}
path: ./wheelhouse/*.whl
...