-
Notifications
You must be signed in to change notification settings - Fork 5
183 lines (151 loc) · 5.04 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
name: Wheels
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels_linux_x64:
name: ${{ matrix.os }} x86_64 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS: x86_64
CIBW_ENVIRONMENT_LINUX: CMAKE_TOOLCHAIN_FILE=/project/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake
# Need to get things ready before we can use vcpkg.
CIBW_BEFORE_ALL_LINUX: yum install -y curl zip unzip tar && /project/ext_libs/vcpkg/bootstrap-vcpkg.sh
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_wheels_windows_x64:
name: ${{ matrix.os }} x86_64 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout specific submodules
run: |
cd ext_libs/vowpal_wabbit
git submodule update --init ext_libs/armadillo-code
git submodule update --init ext_libs/ensmallen
- id: change-path
run: python -c "import pathlib;print('UNIX_PATH='+str(pathlib.PureWindowsPath(r'${{github.workspace}}').as_posix()))" >> $env:GITHUB_OUTPUT
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS: AMD64
CIBW_ENVIRONMENT_WINDOWS: VCPKG_FORCE_DOWNLOADED_BINARIES=true CMAKE_TOOLCHAIN_FILE=${{ steps.change-path.outputs.UNIX_PATH }}/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake SKBUILD_CONFIGURE_OPTIONS='-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded'
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_wheels_macos_universal2:
name: ${{ matrix.os }} universal2 ${{matrix.cibw_python}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
cibw_python: [ "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# We use full vendoring for this since we need to cross compile the ARM piece.
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS_MACOS: universal2
CIBW_ENVIRONMENT_MACOS: SKBUILD_CONFIGURE_OPTIONS='-DVW_NEXT_VENDOR_ALL=ON' MACOSX_DEPLOYMENT_TARGET=10.13
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
check_wheels:
name: Check wheels
needs: [build_wheels_linux_x64, build_wheels_windows_x64, build_wheels_macos_universal2, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install twine
run: pip install twine
- name: Check wheels
run: twine check dist/*
deploy_to_test:
name: Upload if release (test)
environment: "Test-PyPi"
needs: [check_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
deploy_to_prod:
name: Upload if release (prod)
environment: "Prod-PyPi"
needs: [deploy_to_test]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.PYPI_API_TOKEN }}