-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (160 loc) · 6.05 KB
/
reflow-build-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
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
name: "📦🚀 build"
on:
workflow_call:
inputs:
distribution-name:
required: true
type: string
import-name:
required: true
type: string
version:
required: true
type: string
pip_options:
default: ''
required: false
type: string
only-major-dot-minor:
default: 'include all'
required: false
type: string
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ inputs.distribution-name }}-${{ github.event_name }}-${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
jobs:
build:
name: ${{ matrix.os.emoji }} 📦 Build ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: macOS
file-name: macos
matrix: macos
emoji: 🍎
runs-on:
arm: [macOS, ARM64]
intel: [macos-12]
cibw-archs-macos:
arm: arm64
intel: x86_64
macosx-deployment-target:
arm: 11.0
intel: 11.0
- name: Linux
file-name: linux
matrix: linux
emoji: 🐧
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
- name: Windows
file-name: windows
matrix: windows
emoji: 🪟
runs-on:
intel: [windows-latest]
python:
- major-dot-minor: '3.8'
cibw-build: 'cp38-*'
manylinux: manylinux_2_28
matrix: '3.8'
- major-dot-minor: '3.9'
cibw-build: 'cp39-*'
manylinux: manylinux_2_28
matrix: '3.9'
- major-dot-minor: '3.10'
cibw-build: 'cp310-*'
manylinux: manylinux_2_28
matrix: '3.10'
- major-dot-minor: '3.11'
cibw-build: 'cp311-*'
manylinux: manylinux_2_28
matrix: '3.11'
- major-dot-minor: '3.12'
cibw-build: 'cp312-*'
manylinux: manylinux_2_28
matrix: '3.12'
arch:
- name: ARM
file-name: arm
matrix: arm
- name: Intel
file-name: intel
matrix: intel
exclude:
- os:
matrix: windows
arch:
matrix: arm
- python:
major-dot-minor: ${{ (inputs.only-major-dot-minor == 'include all' || inputs.only-major-dot-minor == '3.8') && 'exclude nothing' || '3.8' }}
- python:
major-dot-minor: ${{ (inputs.only-major-dot-minor == 'include all' || inputs.only-major-dot-minor == '3.9') && 'exclude nothing' || '3.9' }}
- python:
major-dot-minor: ${{ (inputs.only-major-dot-minor == 'include all' || inputs.only-major-dot-minor == '3.10') && 'exclude nothing' || '3.10' }}
- python:
major-dot-minor: ${{ (inputs.only-major-dot-minor == 'include all' || inputs.only-major-dot-minor == '3.11') && 'exclude nothing' || '3.11' }}
- python:
major-dot-minor: ${{ (inputs.only-major-dot-minor == 'include all' || inputs.only-major-dot-minor == '3.12') && 'exclude nothing' || '3.12' }}
env:
FILE_NAME: ${{ matrix.os.file-name }}-${{ matrix.arch.file-name }}-${{ matrix.python.major-dot-minor }}
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- uses: Chia-Network/actions/create-venv@main
id: create-venv
- uses: Chia-Network/actions/activate-venv@main
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}
- name: Get source dist
run: |
pip download --no-deps --only-binary :all: --no-binary ${{ inputs.distribution-name }} --extra-index-url https://pypi.chia.net/simple/ --dest packages ${{ inputs.distribution-name }}==${{ inputs.version }}
- name: Untar
run: |
tar -xvzf packages/${{ inputs.distribution-name }}-*
mv ${{ inputs.distribution-name }}-* source
- name: Install tools
run: |
pip install cibuildwheel==2.19.2
- name: Build and test
env:
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
CIBW_BUILD: ${{ matrix.python.cibw-build }}
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.os.macosx-deployment-target[matrix.arch.matrix] }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux }}
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*'
run: |
cibuildwheel source --output-dir dist
- uses: chia-network/actions/create-venv@main
id: create-test-venv
- uses: chia-network/actions/activate-venv@main
with:
directories: ${{ steps.create-test-venv.outputs.activate-venv-directories }}
- name: Install
run: |
ls -la dist
python -m pip install --no-index --only-binary :all: --find-links dist ${{ inputs.distribution-name }}
- name: Import
run: |
python -c 'import ${{ inputs.import-name }}; print(${{ inputs.import-name }})'
- uses: actions/upload-artifact@v4
if: always()
with:
name: wheel-${{ env.FILE_NAME }}
path: ./dist
if-no-files-found: error