-
-
Notifications
You must be signed in to change notification settings - Fork 168
98 lines (88 loc) · 2.69 KB
/
reusable-build-wheel.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
---
name: Build wheel
on:
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
tag:
description: Build platform tag wheels
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 ${{ inputs.tag }} wheels on ${{ inputs.os }} ${{ inputs.qemu }}
runs-on: ${{ inputs.os }}-latest
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/v2
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: x86_64 arm64 universal2
CIBW_CONFIG_SETTINGS: >- # Cython line tracing for coverage collection
pure-python=false
with-cython-tracing=${{ inputs.cython-tracing }}
- name: Upload built artifacts for testing and publishing
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.dists-artifact-name }}-
${{ inputs.os }}-
${{ inputs.qemu }}-
${{ inputs.tag }}
path: ./wheelhouse/*.whl
...