-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (174 loc) · 6.23 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
192
193
194
195
196
197
198
199
name: Package Wheels
on:
push:
branches: ["main"]
# release:
# branches: [ "main" ]
jobs:
build_wheels:
name: Wheel build for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
# Github Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
# should also be able to do multi-archs on a single entry, e.g.
# [os-image, os-name, os-arch]
- [ubuntu-latest, manylinux, x86_64]
- [macos-latest, macosx, x86_64]
- [windows-2019, win, AMD64]
# os: [windows-latest]
# cibw_arch: ["AMD64"]
# cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Set VSDev RC (windows only)
if: runner.os == 'Windows'
run: |
function Invoke-VSDevEnvironment {
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
$Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
& "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object {
if ($_ -match '^([^=]+)=(.*)') {
[System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
}
}
}
Invoke-VSDevEnvironment
Get-Command rc.exe | Format-Table -AutoSize
- name: Build wheels via cibuildwheel
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
# define CC, CXX so meson will use clang-cl instead of MSVC
# CC: clang-cl
# CXX: clang-cl
# CC: gcc
# CXX: g++
# -Wl,-S equivalent to gcc's -Wl,--strip-debug
# LDFLAGS: "-Wl,-S"
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./dist/*.whl
# build_macos_wheels:
# name: Build ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# strategy:
# fail-fast: false
# matrix:
# os: [macos-latest]
# cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
# cibw_arch: ["x86_64", "arm64"] # TODO: add "universal2" once a universal2 libomp is available
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# submodules: true
# - uses: actions/setup-python@v4
# name: Install Python
# with:
# python-version: "3.9"
# - name: Install cibuildwheel
# run: |
# python -m pip install cibuildwheel
# - name: Build wheels for CPython Mac OS
# run: |
# python -m cibuildwheel --output-dir dist
# env:
# CC: /usr/local/opt/llvm/bin/clang
# CXX: /usr/local/opt/llvm/bin/clang
# CIBW_BUILD: ${{ matrix.cibw_python }}
# CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
# CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_TEST_SKIP: "*-macosx_arm64"
# - uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: ./dist/*.whl
# build_linux_wheels:
# name: Build ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# cibw_python: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
# cibw_manylinux: [manylinux2014]
# cibw_arch: ["x86_64"]
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - uses: actions/setup-python@v4
# name: Install Python
# with:
# python-version: "3.9"
# - name: Install cibuildwheel
# run: |
# python -m pip install cibuildwheel
# - name: Build the wheel for Linux
# run: python -m cibuildwheel --output-dir dist
# env:
# CIBW_BUILD: ${{ matrix.cibw_python }}
# CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
# CIBW_SKIP: "*-musllinux_*"
# CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw_manylinux }}
# CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw_manylinux }}
# - uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: ./dist/*.whl
# make_sdist:
# name: Make SDist
# runs-on: ubuntu-latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - uses: actions/setup-python@v4
# name: Install Python
# with:
# python-version: "3.9"
# - name: Build SDist
# run: pipx run build --sdist
# - uses: actions/upload-artifact@v3
# with:
# path: dist/*.tar.gz
# # upload_all:
# # needs: [build_linux_wheels, build_macos_wheels, build_windows_wheels, make_sdist]
# # environment: pypi
# # permissions:
# # id-token: write
# # runs-on: ubuntu-latest
# # if: github.event_name == 'release' && github.event.action == 'published'
# # steps:
# # - uses: actions/download-artifact@v3
# # with:
# # name: artifact
# # path: dist
# # - uses: pypa/gh-action-pypi-publish@release/v1