-
Notifications
You must be signed in to change notification settings - Fork 3
373 lines (364 loc) · 17.3 KB
/
cmake.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
name: CMake
on: [push]
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: Get the version of OpenSSL
id: getversion
run: |
"${{ github.workspace }}/openssl-externalCMake/.github/Scripts-For-Actions/get-version.sh" >> "$GITHUB_OUTPUT"
outputs:
openssl_version: steps.getversion.outputs.OPENSSL_VERSION
build-ubuntu:
strategy:
fail-fast: false
matrix:
runner: [ "20.04", "22.04" ]
asm: [ "YES", "NO" ]
zlib: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
continue-on-error: true
runs-on: ubuntu-${{ matrix.runner }}
name: "build-ubuntu-${{ matrix.runner }} (ASM: ${{ matrix.asm }}, Zlib: ${{ matrix.zlib }}), Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: Ubuntu${{ matrix.runner }}-x86_64-ASM${{ matrix.asm }}-Zlib${{ matrix.zlib }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: add CMake repository and needed softwares
run: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ '"$(. /etc/os-release; echo ${VERSION_CODENAME})"' main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update
sudo apt-get install cmake ninja-build perl build-essential zlib1g-dev
- name: run CMake + Ninja
run: |
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_ZLIB=${{ matrix.zlib }} -DOPENSSL_THREADS=${{ matrix.threads }} "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# - name: run test
# run: |
# cd "build"
# ninja check
- name: package
run: |
tar -cJf "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz
build-macOS:
strategy:
fail-fast: false
matrix:
runner: [ "12", "13" ]
asm: [ "YES", "NO" ]
zlib: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
continue-on-error: true
runs-on: macos-${{ matrix.runner }}
name: "build-macOS${{ matrix.runner }}-x86_64 (ASM: ${{ matrix.asm }}, Zlib: ${{ matrix.zlib }}, Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: macOS${{ matrix.runner }}-x86_64-ASM${{ matrix.asm }}-Zlib${{ matrix.zlib }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: install cmake and ninja
run: |
while ! brew update; do :; done
brew install cmake ninja
- name: run CMake + Ninja
run: |
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_ZLIB=${{ matrix.zlib }} -DOPENSSL_THREADS=${{ matrix.threads }} "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# - name: run test
# run: |
# cd "build"
# ninja check
- name: package
run: |
tar -cJf "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz
build-macOS-aarch64:
strategy:
fail-fast: false
matrix:
runner: [ "12", "13" ]
asm: [ "YES", "NO" ]
zlib: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
continue-on-error: true
runs-on: macos-${{ matrix.runner }}
name: "build-macOS${{ matrix.runner }}-aarch64 (ASM: ${{ matrix.asm }}, Zlib: ${{ matrix.zlib }}, Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: macOS${{ matrix.runner }}-aarch64-ASM${{ matrix.asm }}-Zlib${{ matrix.zlib }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: install cmake and ninja
run: |
while ! brew update; do :; done
brew install cmake ninja
- name: run CMake + Ninja
run: |
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="arm64" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_ZLIB=${{ matrix.zlib }} -DOPENSSL_THREADS=${{ matrix.threads }} "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# Tests can not run. GitHub actions runs on x86_64 and there is no Rosetta2 available.
- name: package
run: |
tar -cJf "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz
build-macOS-unified:
strategy:
fail-fast: false
matrix:
runner: [ "12", "13" ]
# can't build ASM on unified.
zlib: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
continue-on-error: true
runs-on: macos-${{ matrix.runner }}
name: "build-macOS${{ matrix.runner }}-unified (Zlib: ${{ matrix.zlib }}, Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: macOS${{ matrix.runner }}-unified-Zlib${{ matrix.zlib }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: install cmake and ninja
run: |
while ! brew update; do :; done
brew install cmake ninja
- name: run CMake + Ninja
run: |
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DOPENSSL_ASM=NO -DOPENSSL_ZLIB=${{ matrix.zlib }} -DOPENSSL_THREADS=${{ matrix.threads }} "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# Tests need not run. Same as no-asm x86_64 since GitHub actions runs on x86_64 and there is no Rosetta2 available
- name: package
run: |
tar -cJf "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz
build-MinGW:
strategy:
fail-fast: false
matrix:
toolchain:
- version: "12.2.0"
bit: "64"
arch: "x86_64"
url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/x86_64-12.2.0-release-posix-seh-msvcrt-rt_v10-rev2.7z"
- version: "12.2.0"
bit: "32"
arch: "i686"
url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/i686-12.2.0-release-posix-dwarf-msvcrt-rt_v10-rev2.7z"
- version: "13.1.0"
bit: "64"
arch: "x86_64"
url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.1.0-rt_v11-rev1/x86_64-13.1.0-release-posix-seh-msvcrt-rt_v11-rev1.7z"
asm: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
continue-on-error: true
runs-on: windows-latest
name: "build-MinGW-GCC${{ matrix.toolchain.version }}-${{ matrix.toolchain.bit }}bit (ASM: ${{ matrix.asm }}, Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: MinGWGCC${{ matrix.toolchain.version }}-${{ matrix.toolchain.arch }}-ASM${{ matrix.asm }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: add CMake repository and needed softwares
run: |
choco install cmake
choco install ninja
- name: install MinGW toolchain
run: |
New-Item -Path "." -Name "mingw" -ItemType "directory";
(New-Object System.Net.WebClient).DownloadFile("${{ matrix.toolchain.url }}","mingw/mingw.7z");
cmd /c cd mingw "&&" 7z x mingw.7z
- name: run CMake + Ninja
shell: cmd
run: |
del /s /q C:\Strawberry\perl\bin\pkg-config.bat
set path=${{ github.workspace }}\mingw\mingw${{ matrix.toolchain.bit }}\\bin;%path%
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_THREADS=${{ matrix.threads }} -DPOD2MAN="C:\Strawberry\perl\bin\pod2man.bat" "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# - name: run test
# shell: cmd
# run: |
# set path=${{ github.workspace }}\mingw\mingw${{ matrix.toolchain.bit }}\\bin;%path%
# cd "build"
# ninja check
- name: package
run: |
7z a "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.7z" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.7z
build-msvc:
strategy:
fail-fast: false
matrix:
toolchain:
- version: "2022"
runson: "2022"
call: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
bit: "64"
arch: "x86_64"
- version: "2019"
runson: "2019"
call: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
bit: "64"
arch: "x86_64"
- version: "2019"
runson: "2019"
call: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat
bit: "32"
arch: "i686"
asm: [ "YES", "NO" ]
# msvc builds doesn't support no-thread
continue-on-error: true
runs-on: windows-${{ matrix.toolchain.runson }}
name: "build-MSVC${{ matrix.toolchain.version }}-${{ matrix.toolchain.bit }}bit (ASM: ${{ matrix.asm }})"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: MSVC${{ matrix.toolchain.version }}-${{ matrix.toolchain.arch }}-ASM${{ matrix.asm }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: add CMake repository and needed softwares
run: |
choco install cmake
choco install ninja
choco install nasm
- name: run CMake + Ninja
shell: cmd
run: |
del /s /q C:\Strawberry\perl\bin\pkg-config.bat
call "${{ matrix.toolchain.call }}"
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_NASM=${{ matrix.asm }} -DPOD2MAN="C:\Strawberry\perl\bin\pod2man.bat" "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# - name: run test
# shell: cmd
# run: |
# call "${{ matrix.toolchain.call }}"
# cd "build"
# ninja check
- name: package
run: |
7z a "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.7z" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.7z
# temporarily use latest NDK from GitHub Actions.
# switch to LTS of its time (maybe r26) after OpenSSL 1.1 series get EOL.
build-android:
strategy:
fail-fast: false
matrix:
toolchain:
- arch: "armeabi-v7a"
platform: "24"
- arch: "arm64-v8a"
platform: "24"
- arch: "x86"
platform: "24"
- arch: "x86_64"
platform: "24"
- arch: "armeabi-v7a"
platform: "27"
- arch: "arm64-v8a"
platform: "27"
- arch: "x86"
platform: "27"
- arch: "x86_64"
platform: "27"
asm: [ "YES", "NO" ]
threads: [ "YES", "NO" ]
zlib: [ "YES", "NO" ]
continue-on-error: true
runs-on: ubuntu-latest
name: "build-AndroidAPI${{ matrix.toolchain.platform }}-${{ matrix.toolchain.arch }} (ASM: ${{ matrix.asm }}, Zlib: ${{ matrix.zlib }}), Threads: ${{ matrix.threads }}"
needs: get-version
env:
FS_OPENSSL_PACKAGE_STR: AndroidAPI${{ matrix.toolchain.platform }}-${{ matrix.toolchain.arch }}}-ASM${{ matrix.asm }}Zlib${{ matrix.zlib }}-Threads${{ matrix.threads }}
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
path: openssl-externalCMake
- name: add CMake repository and needed softwares
run: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ '"$(. /etc/os-release; echo ${VERSION_CODENAME})"' main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update
sudo apt-get install cmake ninja-build perl
- name: run CMake + Ninja
run: |
mkdir -p "build"
cd "build"
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=${{ matrix.toolchain.arch }} -DANDROID_PLATFORM=${{ matrix.toolchain.platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=${{ matrix.asm }} -DOPENSSL_ZLIB=${{ matrix.zlib }} -DOPENSSL_THREADS=${{ matrix.threads }} "${{ github.workspace }}/openssl-externalCMake"
ninja
cmake --install . --strip
# test can't be run due to the syntax is not compatible with Android. TODO: android emulator
- name: package
run: |
tar -cJf "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz" "openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}"
- uses: actions/upload-artifact@v3
with:
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}
path: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}.tar.xz