-
Notifications
You must be signed in to change notification settings - Fork 6
328 lines (316 loc) · 12.9 KB
/
build-boost.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
name: Build Boost
on:
workflow_dispatch:
inputs:
version:
description: 'Boost version to build'
required: true
release:
description: 'Release'
type: boolean
required: false
default: true
delete-previous:
description: 'Delete previous release'
type: boolean
required: false
default: true
jobs:
build:
strategy:
matrix:
include:
# Ubuntu
- os: ubuntu-20.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: x86
- os: ubuntu-20.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: aarch64
- os: ubuntu-22.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: x86
# Windows Server 2019
- os: windows-2019
COMPILER: msvc
LINK: 'static'
ARCH: x86
- os: windows-2019
COMPILER: msvc
LINK: 'shared'
ARCH: x86
- os: windows-2019
COMPILER: mingw
LINK: 'static'
ARCH: x86
#- os: windows-2019
# COMPILER: mingw
# LINK: 'shared'
# ARCH: x86
# Windows Server 2022
- os: windows-2022
COMPILER: msvc
LINK: 'static'
ARCH: x86
- os: windows-2022
COMPILER: msvc
LINK: 'shared'
ARCH: x86
- os: windows-2022
COMPILER: mingw
LINK: 'static'
ARCH: x86
#- os: windows-2022
# COMPILER: mingw
# LINK: 'shared'
# ARCH: x86
# MacOs
- os: macos-11
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-12
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-13
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-14
COMPILER: clang
LINK: 'static+shared'
ARCH: aarch64
runs-on: ${{matrix.os}}
steps:
- name: git clone
run: git clone https://github.com/boostorg/boost
- name: git checkout
run: git checkout tags/boost-${{github.event.inputs.version}}
working-directory: boost
- name: git submodule init
run: git submodule update --init --recursive
working-directory: boost
- name: Delete .git windows
run: RD /S /Q .git
if: runner.os == 'Windows'
shell: cmd
working-directory: boost
- name: Delete .git unix
run: rm -rf .git
if: runner.os != 'Windows'
working-directory: boost
# Setup cl.exe (windows only)
- name: Setup VS Dev Environment
uses: compnerd/gha-setup-vsdevenv@v6
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' }}
# Setup MinGW (windows only)
#- name: Setup MinGW
# uses: egor-tensin/setup-mingw@v2
# if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
# Install ARM Toolchain on ubuntu
- name: Install ARM Toolchain
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
# Install python
- name: Setup python 3.7
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.7'
- name: Add python 3.7 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.7 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.8
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.8'
- name: Add python 3.8 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.8 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.9
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.9'
- name: Add python 3.9 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.9 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.10
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.10'
- name: Add python 3.10 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.10 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.11
uses: actions/setup-python@v5
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
with:
python-version: '3.11'
- name: Add python 3.11 to user-config
working-directory: boost/tools/build/src
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
shell: bash
run: |
VAR="using python : 3.11 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.12
uses: actions/setup-python@v5
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
with:
python-version: '3.12'
- name: Add python 3.12 to user-config
working-directory: boost/tools/build/src
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
shell: bash
run: |
VAR="using python : 3.12 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
# Build steps
- name: Bootstrap windows
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' }}
run: .\bootstrap.bat msvc
working-directory: boost
- name: Bootstrap windows MinGW
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
run: .\bootstrap.bat mingw
working-directory: boost
- name: Bootstrap unix
if: runner.os != 'Windows'
run: ./bootstrap.sh
working-directory: boost
- name: Build windows msvc (static)
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' && matrix.LINK == 'static' }}
#run: .\b2.exe install --build-dir='tmp' --prefix='.' runtime-link='static,shared' link='static,shared' variant='release,debug' address-model='32,64' -j4 msvc stage
run: .\b2.exe install --build-dir='tmp' --prefix='.' variant='release,debug' address-model='32,64' link=${{matrix.LINK}} python='3.7,3.8,3.9,3.10,3.11,3.12' -j4 msvc stage
working-directory: boost
- name: Build windows msvc (shared) without python
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' && matrix.LINK == 'shared' }}
run: .\b2.exe install --build-dir='tmp' --prefix='.' --without-python variant='release,debug' address-model='32,64' link=${{matrix.LINK}} -j4 msvc stage
working-directory: boost
- name: Build windows mingw
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
run: .\b2.exe install --build-dir='tmp' --prefix='.' variant='release,debug' runtime-link='static,shared' address-model='32,64' --hash -j4 toolset=gcc stage
working-directory: boost
- name: Build debug unix x86
if: ${{ runner.os != 'Windows' && matrix.ARCH == 'x86' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' python='3.7,3.8,3.9,3.10,3.11,3.12' -j2
working-directory: boost
- name: Build release unix x86
if: ${{ runner.os != 'Windows' && matrix.ARCH == 'x86' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' python='3.7,3.8,3.9,3.10,3.11,3.12' -j2
working-directory: boost
- name: Build debug macos arm64
if: ${{ runner.os == 'macOS' && matrix.ARCH == 'aarch64' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' python='3.11,3.12' -j2
working-directory: boost
- name: Build release macos arm64
if: ${{ runner.os == 'macOS' && matrix.ARCH == 'aarch64' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' python='3.11,3.12' -j2
working-directory: boost
- name: Build debug ubuntu arm
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
echo "using gcc : aarch64 : aarch64-linux-gnu-g++ ;" > user-config.jam
./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' \
toolset='gcc-aarch64' --without-python address-model=64 --user-config=./user-config.jam -j2
working-directory: boost
- name: Build release ubuntu arm
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
echo "using gcc : aarch64 : aarch64-linux-gnu-g++ ;" > user-config.jam
./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' \
toolset='gcc-aarch64' --without-python address-model=64 --user-config=./user-config.jam -j2
working-directory: boost
- name: Copy include directories
if: ${{ runner.os == 'Windows' }}
working-directory: boost
shell: bash
run: cp -r include/boost-*/boost include/boost
# Upload steps
- name: Cleanup windows
run: RD /S /Q tmp
if: runner.os == 'Windows'
shell: cmd
working-directory: boost
- name: Cleanup unix
run: rm -rf tmp
if: runner.os != 'Windows'
working-directory: boost
- name: Compress files
run: tar -czf boost-${{github.event.inputs.version}}-${{matrix.os}}-${{matrix.COMPILER}}-${{matrix.LINK}}-${{matrix.ARCH}}.tar.gz boost
- name: Upload boost artifact
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: boost-${{matrix.os}}-${{matrix.COMPILER}}-${{matrix.LINK}}-${{matrix.ARCH}}
path: "boost-*.tar.gz"
upload:
runs-on: ubuntu-latest
needs: [build]
if: github.event.inputs.release == 'true'
#if: github.ref_name == 'main'
steps:
- name: Delete previous release
uses: dev-drprasad/[email protected]
if: github.event.inputs.delete-previous == 'true'
with:
tag_name: ${{github.event.inputs.version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Download all Artifacts
uses: actions/download-artifact@v4
- name: Move artifacts
shell: bash
run: |
mv */* .
find . -type d -empty -delete
- name: Create Release
uses: ncipollo/release-action@v1
with:
draft: false
tag: ${{github.event.inputs.version}}
artifacts: "boost-*"
token: ${{ secrets.GITHUB_TOKEN }}
update-manifest:
runs-on: ubuntu-latest
needs: [upload]
if: github.event.inputs.release == 'true'
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
working-directory: manifest-creator
- name: Update manifest
run: npm start
working-directory: manifest-creator
- name: Commit manifest
uses: EndBug/add-and-commit@v9
with:
add: versions-manifest.json
message: 'chore: update versions-manifest'