-
Notifications
You must be signed in to change notification settings - Fork 3
234 lines (196 loc) · 6.97 KB
/
esig.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
name: Build esig
on:
push:
branches:
- release
- develop
paths-ignore:
- 'examples/**'
- 'doc/**'
- README.md
pull_request:
branches:
- develop
types: [ opened, reopened, synchronize]
env:
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
windows-2019,
macos-13,
macos-14,
ubuntu-latest
]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout recombine
id: clone_recombine
if: runner.os != 'macOs'
uses: actions/checkout@v4
with:
repository: datasig-ac-uk/recombine
path: build/recombine
- name: Setup gha caching for vcpkg
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
- name: Setup submodule vcpkg
shell: bash
if: runner.os != 'Linux'
run: |
rm -rf "$VCPKG_INSTALLATION_ROOT"
./build/vcpkg/bootstrap-vcpkg.sh
# In the future, this can be replaced by a download of the binary
# - name: Get recombine
# id: clone_recombine
# run: |
# bash ./build/git-preamble.sh
# continue-on-error: true
# env:
# RECOMBINE_USER: rolyp
# RECOMBINE_TOKEN: ${{ secrets.recombine_login }}
# - name: MKL Cache
# id: mkl-cache-get-windows
# if: runner.os == 'Windows'
# uses: pat-s/[email protected]
# with:
# key: ${{ runner.os }}-oneapi-dir
# path: |
# !C:/Program Files (x86)/Intel/oneAPI/Installer/**
# C:/Program Files (x86)/Intel/oneAPI
# !C:/Program Files (x86)/Intel/oneAPI/conda_channel/**
- name: Get MKL
id: get-mkl-windows
if: runner.os == 'Windows' # && steps.mkl-cache-get-windows.outputs.cache-hit != 'true'
shell: bash
run: |
curl -v -o /d/a/intel-mkl-installer.exe "$URL"
/d/a/intel-mkl-installer.exe -s -x -f /d/a/webimage_extracted --log extract.log
rm -v /d/a/intel-mkl-installer.exe
/d/a/webimage_extracted/bootstrapper.exe -s --action install --config ./build/oneapi-install-config-x64-windows.ini --log-dir=.
curl -v -o /d/a/intel-mkl-installer-x86.exe "$URL32"
/d/a/intel-mkl-installer-x86.exe -s -x -f /d/a/webimage_extracted_x86 --log extractx86.log
rm -v /d/a/intel-mkl-installer-x86.exe
/d/a/webimage_extracted_x86/bootstrapper.exe -s --action install --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=. --ignore-errors
env:
URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/53c45adf-95f6-465b-bdb5-99d0627a6791/intelpython3-2024.2.0_444-Windows-x86_64.exe
URL32: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_32bit_p_2024.2.1.7.exe
- name: Set MKL vars
if: runner.os == 'Windows'
shell: bash
# run: |
# @call "C:/Program Files (x86)/Intel/oneAPI/setvars.bat"
# set
# echo "MKLROOT=%MKLROOT%" >> %GITHUB_ENV%
run: |
echo "CMAKE_PREFIX_PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.0.3" >> $GITHUB_ENV
echo "ONEAPI_SCRIPT=C:/Progam Files (x86)/Intel/oneAPI/setvars.bat" >> $GITHUB_ENV
# - name: cache-boost-windows
# id: cache-boost-windows
# uses: pat-s/[email protected]
# if: runner.os == 'Windows'
# with:
# path: C:/vcpkg/packages
# key: win-boost-packages
- name: Get Boost Windows
id: boost-windows
shell: bash
run: |
build/vcpkg/vcpkg install boost-system boost-thread boost-container boost-multiprecision --triplet x86-windows
build/vcpkg/vcpkg install boost-system boost-thread boost-container boost-multiprecision --triplet x64-windows
if: runner.os == 'Windows'
env:
VCPKG_KEEP_ENV_VARS: "MKLROOT"
- name: Get Boost macos
id: boost-macos
run: |
find /usr/lib -name omp
brew install boost
brew install ninja
if: runner.os == 'macOS'
# - name: Build Recombine
# id: build-recombine
# if: steps.clone_recombine.outcome == 'success' && runner.os != 'Linux'
# run: |
# source ${{ env.oneapi_script }}
# pushd build/recombine
# cmake -S . -B recombine_build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../esig
# cmake --install recombine_build
# popd
# echo "recombine_prefix=$(pwd)/esig" >> $GITHUB_ENV
# env:
# MKLROOT: ${{ env.MKLROOT }}
- name: Build wheels
uses: pypa/[email protected]
env:
VERBOSE: 1
BOOST_ROOT: ${{ env.boost_root }}
- name: Cache outputs
uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
build_sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Build deps
run: python -m pip install wheel setuptools build
# - name: Check version updated
# - name: Copy manifest into main dir
# run: cp build/MANIFEST.in .
- name: Build source distribution
run: python -m build --sdist .
- name: Cache sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
# - name: Create GitHub release
# run: |
# gh release create "v$(<esig/VERSION)" ./dist/*.whl
publish:
runs-on: ubuntu-latest
needs: [ build_wheels, build_sdist ]
if: github.ref == 'refs/heads/release'
steps:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Build deps
run: python -m pip install setuptools wheel build twine
- name: Retrieve sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Retrieve wheels
uses: actions/download-artifact@v4
with:
name: wheels
path: dist
- name: Publish
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}