-
Notifications
You must be signed in to change notification settings - Fork 206
596 lines (519 loc) · 29.6 KB
/
build.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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# name: Build
# on: [push]
# env:
# BUILD_TYPE: Release
# BUILD_CONFIG: RelWithDebInfo
# jobs:
# ###############################################################################
# # Build Desktop
# ###############################################################################
# build_desktop:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macos-10.15, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-2019]
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# ###############################################################################
# # Create Build Environment
# ###############################################################################
# - name: Create Build Environment [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: |
# echo $GITHUB_WORKSPACE
# echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]" >> $GITHUB_ENV
# - name: Create Build Environment [ununtu all]
# shell: bash
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# run: |
# sudo apt-get update
# sudo apt-get install libssl-dev curl libxi-dev libcups2-dev -y
# - name: Create Build Environment [ubuntu 16.04]
# shell: bash
# if: matrix.os == 'ubuntu-16.04'
# run: |
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
# sudo update-alternatives --set gcc "/usr/bin/gcc-9"
# - name: Create Build Environment [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: |
# git clone --depth=1 https://github.com/BeamMW/libs.git c:/beam-libs
# echo "OPENSSL_ROOT_DIR=c:\beam-libs\openssl" >> $GITHUB_ENV
# git clone --depth=1 https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git c:/boost_prebuild
# echo "BOOST_ROOT=c:\boost_prebuild" >> $GITHUB_ENV
# - name: Download boost [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: |
# brew update
# brew install boost
# echo "LDFLAGS=-L/usr/local/opt/icu4c/lib" >> $GITHUB_ENV
# echo "CPPFLAGS=-I/usr/local/opt/icu4c/include" >> $GITHUB_ENV
# - name: Download boost [ununtu all]
# shell: bash
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# run: |
# git clone --depth=1 https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git ${{runner.workspace}}/boost_prebuild
# echo "BOOST_INCLUDEDIR=${{runner.workspace}}/boost_prebuild/include" >> $GITHUB_ENV
# echo "BOOST_LIBRARYDIR=${{runner.workspace}}/boost_prebuild/lib/" >> $GITHUB_ENV
# ###############################################################################
# # Configure CMake
# ###############################################################################
# - name: Configure CMake [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: |
# # git apply 3rdparty/protobuf-patch.diff
# cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDEBUG_MESSAGES_IN_RELEASE_MODE=On -DBEAM_LINK_TYPE=Static -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_HW_WALLET=Off .
# - name: Configure CMake [ununtu all]
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# run: |
# # git apply 3rdparty/protobuf-patch.diff
# cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDEBUG_MESSAGES_IN_RELEASE_MODE=On -DBEAM_LINK_TYPE=Static -DBEAM_USE_STATIC_RUNTIME=ON -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_HW_WALLET=Off .
# - name: Configure CMake [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: |
# # git apply 3rdparty/protobuf-patch.diff
# cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING=$BUILD_CONFIG -DBEAM_LINK_TYPE=Static -DBEAM_USE_STATIC_RUNTIME=On -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_BUILD_JNI=Off -DBEAM_HW_WALLET=Off .
# - name: Save version info
# shell: bash
# run: |
# echo "BEAM_VERSION=$(cat beam_version.gen)" >> $GITHUB_ENV
# echo "BEAM_TARGET_SUFFIX=-masternet" >> $GITHUB_ENV
# rm beam_version.gen
# ###############################################################################
# # Build
# ###############################################################################
# - name: Build [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: cmake --build . --parallel --config $BUILD_TYPE
# - name: Build [ununtu all]
# shell: bash
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# run: make -j$(nproc)
# - name: Build [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: cmake --build . --config $BUILD_CONFIG --parallel
# ###############################################################################
# # Test
# ###############################################################################
# - name: Test [macos-10.15]
# if: matrix.os == 'macos-10.15'
# continue-on-error: false
# run: ctest -C $BUILD_TYPE --verbose
# - name: Test [ununtu all]
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# continue-on-error: false
# shell: bash
# run: ctest --verbose
# - name: Test [windows]
# if: matrix.os == 'windows-2019'
# continue-on-error: false
# shell: bash
# run: ctest -C $BUILD_CONFIG --verbose
# ###############################################################################
# # Collect artifacts
# ###############################################################################
# - name: Import Code-Signing Certificates [macos-10.15]
# if: matrix.os == 'macos-10.15'
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
# p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
# - name: Sign the mac binaries [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: |
# codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp beam/beam-node${{env.BEAM_TARGET_SUFFIX}}
# codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp wallet/cli/beam-wallet${{env.BEAM_TARGET_SUFFIX}}
# codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp wallet/api/wallet-api${{env.BEAM_TARGET_SUFFIX}}
# codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp explorer/explorer-node${{env.BEAM_TARGET_SUFFIX}}
# codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp wallet/broadcaster/broadcaster${{env.BEAM_TARGET_SUFFIX}}
# - name: Collect [macos-10.15 && ununtu all]
# shell: bash
# if: matrix.os != 'windows-2019'
# run: |
# mkdir artifacts
# tar -cvf artifacts/beam-node.tar -C beam beam-node${{env.BEAM_TARGET_SUFFIX}} beam-node.cfg
# tar -cvf artifacts/beam-wallet.tar -C wallet/cli beam-wallet${{env.BEAM_TARGET_SUFFIX}} beam-wallet.cfg
# tar -cvf artifacts/wallet-api.tar -C wallet/api wallet-api${{env.BEAM_TARGET_SUFFIX}} wallet-api.cfg
# tar -cvf artifacts/explorer-node.tar -C explorer explorer-node${{env.BEAM_TARGET_SUFFIX}} explorer-node.cfg
# tar -cvf artifacts/broadcaster.tar -C wallet/broadcaster broadcaster${{env.BEAM_TARGET_SUFFIX}}
# - name: Collect [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: |
# mkdir artifacts
# cp beam/${{env.BUILD_CONFIG}}/beam-node${{env.BEAM_TARGET_SUFFIX}}.exe artifacts/beam-node${{env.BEAM_TARGET_SUFFIX}}.exe
# cp beam/beam-node.cfg artifacts/beam-node.cfg
# cp wallet/cli/${{env.BUILD_CONFIG}}/beam-wallet${{env.BEAM_TARGET_SUFFIX}}.exe artifacts/beam-wallet${{env.BEAM_TARGET_SUFFIX}}.exe
# cp wallet/cli/beam-wallet.cfg artifacts/beam-wallet.cfg
# cp wallet/api/${{env.BUILD_CONFIG}}/wallet-api${{env.BEAM_TARGET_SUFFIX}}.exe artifacts/wallet-api${{env.BEAM_TARGET_SUFFIX}}.exe
# cp wallet/api/wallet-api.cfg artifacts/wallet-api.cfg
# cp explorer/${{env.BUILD_CONFIG}}/explorer-node${{env.BEAM_TARGET_SUFFIX}}.exe artifacts/explorer-node${{env.BEAM_TARGET_SUFFIX}}.exe
# cp explorer/explorer-node.cfg artifacts/explorer-node.cfg
# cp wallet/broadcaster/${{env.BUILD_CONFIG}}/broadcaster${{env.BEAM_TARGET_SUFFIX}}.exe artifacts/broadcaster${{env.BEAM_TARGET_SUFFIX}}.exe
# - name: Collect pdb [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: |
# mkdir pdb
# cp beam/${{env.BUILD_CONFIG}}/beam-node${{env.BEAM_TARGET_SUFFIX}}.pdb pdb/beam-node${{env.BEAM_TARGET_SUFFIX}}.pdb
# cp wallet/cli/${{env.BUILD_CONFIG}}/beam-wallet${{env.BEAM_TARGET_SUFFIX}}.pdb pdb/beam-wallet${{env.BEAM_TARGET_SUFFIX}}.pdb
# cp wallet/api/${{env.BUILD_CONFIG}}/wallet-api${{env.BEAM_TARGET_SUFFIX}}.pdb pdb/wallet-api${{env.BEAM_TARGET_SUFFIX}}.pdb
# cp explorer/${{env.BUILD_CONFIG}}/explorer-node${{env.BEAM_TARGET_SUFFIX}}.pdb pdb/explorer-node${{env.BEAM_TARGET_SUFFIX}}.pdb
# cp wallet/broadcaster/${{env.BUILD_CONFIG}}/broadcaster${{env.BEAM_TARGET_SUFFIX}}.pdb pdb/broadcaster${{env.BEAM_TARGET_SUFFIX}}.pdb
# # - name: Checksum [macos-10.15]
# # if: matrix.os == 'macos-10.15'
# # run: |
# # shasum -a 256 artifacts/beam-node${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-beam-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # shasum -a 256 artifacts/beam-wallet${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-beam-wallet${{env.BEAM_TARGET_SUFFIX}}.txt
# # shasum -a 256 artifacts/wallet-api${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-wallet-api${{env.BEAM_TARGET_SUFFIX}}.txt
# # shasum -a 256 artifacts/explorer-node${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-explorer-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # shasum -a 256 artifacts/broadcaster${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-broadcaster${{env.BEAM_TARGET_SUFFIX}}.txt
# # - name: Checksum [ubuntu]
# # if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# # run: |
# # sha256sum artifacts/beam-node${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-beam-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # sha256sum artifacts/beam-wallet${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-beam-wallet${{env.BEAM_TARGET_SUFFIX}}.txt
# # sha256sum artifacts/wallet-api${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-wallet-api${{env.BEAM_TARGET_SUFFIX}}.txt
# # sha256sum artifacts/explorer-node${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-explorer-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # sha256sum artifacts/broadcaster${{env.BEAM_TARGET_SUFFIX}} > artifacts/checksum-broadcaster${{env.BEAM_TARGET_SUFFIX}}.txt
# # - name: Checksum [windows]
# # if: matrix.os == 'windows-2019'
# # run: |
# # certUtil -hashfile artifacts/beam-node${{env.BEAM_TARGET_SUFFIX}}.exe SHA256 > artifacts/checksum-beam-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # certUtil -hashfile artifacts/beam-wallet${{env.BEAM_TARGET_SUFFIX}}.exe SHA256 > artifacts/checksum-beam-wallet${{env.BEAM_TARGET_SUFFIX}}.txt
# # certUtil -hashfile artifacts/wallet-api${{env.BEAM_TARGET_SUFFIX}}.exe SHA256 > artifacts/checksum-wallet-api${{env.BEAM_TARGET_SUFFIX}}.txt
# # certUtil -hashfile artifacts/explorer-node${{env.BEAM_TARGET_SUFFIX}}.exe SHA256 > artifacts/checksum-explorer-node${{env.BEAM_TARGET_SUFFIX}}.txt
# # certUtil -hashfile artifacts/broadcaster${{env.BEAM_TARGET_SUFFIX}}.exe SHA256 > artifacts/checksum-broadcaster${{env.BEAM_TARGET_SUFFIX}}.txt
# - name: OS name [macos-10.15]
# if: matrix.os == 'macos-10.15'
# run: echo "OS_NAME=mac" >> $GITHUB_ENV
# - name: OS name [ununtu all]
# shell: bash
# if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
# run: echo "OS_NAME=${{matrix.os}}" >> $GITHUB_ENV
# - name: OS name [windows]
# shell: bash
# if: matrix.os == 'windows-2019'
# run: echo "OS_NAME=win" >> $GITHUB_ENV
# ###############################################################################
# # Upload
# ###############################################################################
# - uses: actions/upload-artifact@v2
# with:
# name: ${{env.OS_NAME}}-beam-node${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/beam-node*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: ${{env.OS_NAME}}-beam-wallet-cli${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/beam-wallet*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: ${{env.OS_NAME}}-wallet-api${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/wallet-api*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: ${{env.OS_NAME}}-explorer-node${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/explorer-node*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: ${{env.OS_NAME}}-broadcaster${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/broadcaster*
# if-no-files-found: error
# # - uses: actions/upload-artifact@v2
# # with:
# # name: ${{env.OS_NAME}}-checksums${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# # path: artifacts/checksum*
# # if-no-files-found: error
# ###############################################################################
# # Upload linux-prefix
# ###############################################################################
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-16.04'
# with:
# name: linux-beam-node${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/beam-node*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-16.04'
# with:
# name: linux-beam-wallet-cli${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/beam-wallet*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-16.04'
# with:
# name: linux-wallet-api${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/wallet-api*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-16.04'
# with:
# name: linux-explorer-node${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/explorer-node*
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-16.04'
# with:
# name: linux-broadcaster${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: artifacts/broadcaster*
# if-no-files-found: error
# # - uses: actions/upload-artifact@v2
# # with:
# # name: linux-checksums${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# # path: artifacts/checksum*
# # if-no-files-found: error
# ###############################################################################
# # Upload windows pdb
# ###############################################################################
# - uses: actions/upload-artifact@v2
# if: matrix.os == 'windows-2019'
# with:
# name: pdb${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: pdb
# if-no-files-found: error
# ###############################################################################
# # Build IOS
# ###############################################################################
# build_ios:
# runs-on: macos-10.15
# # if: ${{false}}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# ###############################################################################
# # Create Build Environment
# ###############################################################################
# - name: Create Build Environment
# run: |
# git clone --depth=1 https://github.com/BeamMW/boost-ios.git ${{runner.workspace}}/dependencies/boost-ios
# git clone --depth=1 https://github.com/BeamMW/boost-ios-simulator.git ${{runner.workspace}}/dependencies/boost-ios-simulator
# git clone --depth=1 https://github.com/BeamMW/openssl-ios.git ${{runner.workspace}}/dependencies/openssl-ios
# git clone --depth=1 https://github.com/leetal/ios-cmake.git ${{runner.workspace}}/dependencies/toolchain-ios
# # echo "BUILD_TYPE=Release" >> $GITHUB_ENV
# echo "OPENSSL_ROOT_DIR=${{runner.workspace}}/dependencies/openssl-ios/" >> $GITHUB_ENV
# echo "OPENSSL_CRYPTO_LIBRARY=${{runner.workspace}}/dependencies/openssl-ios/lib/libcrypto.a" >> $GITHUB_ENV
# echo "OPENSSL_INCLUDE_DIR=${{runner.workspace}}/dependencies/openssl-ios/include" >> $GITHUB_ENV
# echo "OPENSSL_SSL_LIBRARY=${{runner.workspace}}/dependencies/openssl-ios/lib/libssl.a" >> $GITHUB_ENV
# echo "OPENSSL_LIBRARIES=${{runner.workspace}}/dependencies/openssl-ios/lib" >> $GITHUB_ENV
# ###############################################################################
# # Configure CMake && Build
# ###############################################################################
# - name: Configure CMake && Build
# run: |
# # git apply 3rdparty/protobuf-patch.diff
# export BOOST_ROOT_IOS="${{runner.workspace}}/dependencies/boost-ios"
# cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}/dependencies/toolchain-ios/ios.toolchain.cmake -DPLATFORM=OS64 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DDEPLOYMENT_TARGET=11.0 -DENABLE_BITCODE=NO -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_CRYPTO_LIBRARY -DOPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR -DOPENSSL_SSL_LIBRARY=$OPENSSL_SSL_LIBRARY -DOPENSSL_LIBRARIES=$OPENSSL_LIBRARIES -DIOS=YES -Wno-error=deprecated-declarations -Wno-error=deprecated -DCMAKE_TRY_COMPILE_PLATFORM_VARIABLES=CMAKE_WARN_DEPRECATED -B./build
# make -C ./build -j$(sysctl -n hw.ncpu)
# export BOOST_ROOT_IOS="${{runner.workspace}}/dependencies/boost-ios-simulator"
# cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}/dependencies/toolchain-ios/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DDEPLOYMENT_TARGET=11.0 -DENABLE_BITCODE=NO -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_CRYPTO_LIBRARY -DOPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR -DOPENSSL_SSL_LIBRARY=$OPENSSL_SSL_LIBRARY -DOPENSSL_LIBRARIES=$OPENSSL_LIBRARIES -DIOS=YES -Wno-error=deprecated-declarations -Wno-error=deprecated -DCMAKE_TRY_COMPILE_PLATFORM_VARIABLES=CMAKE_WARN_DEPRECATED -B./build-simulator
# make -C ./build-simulator -j$(sysctl -n hw.ncpu)
# - name: Save version info
# run: |
# echo "BEAM_VERSION=$(cat beam_version.gen)" >> $GITHUB_ENV
# echo "BEAM_TARGET_SUFFIX=-masternet" >> $GITHUB_ENV
# rm beam_version.gen
# ###############################################################################
# # Collect artifacts
# ###############################################################################
# - name: Collect
# run: |
# echo BEAM_VERSION = $BEAM_VERSION
# mkdir -p ${{runner.workspace}}/results/beam-ios/include
# mkdir -p ${{runner.workspace}}/results/beam-ios/lib
# find ./build -name \*.a -type f -exec cp {} ${{runner.workspace}}/results/beam-ios/lib/ \;
# rsync -am --include='*.h' --include='*.hpp' --include='*/' --exclude='*' . ${{runner.workspace}}/results/beam-ios/include/
# cp ./build/core/version.h ${{runner.workspace}}/results/beam-ios/include/core/
# mkdir -p ${{runner.workspace}}/results/beam-ios-simulator/include
# mkdir -p ${{runner.workspace}}/results/beam-ios-simulator/lib
# find ./build-simulator -name \*.a -type f -exec cp {} ${{runner.workspace}}/results/beam-ios-simulator/lib/ \;
# rsync -am --include='*.h' --include='*.hpp' --include='*/' --exclude='*' . ${{runner.workspace}}/results/beam-ios-simulator/include/
# cp ./build/core/version.h ${{runner.workspace}}/results/beam-ios-simulator/include/core/
# mkdir -p ${{runner.workspace}}/results/beam-ios-combined/include
# mkdir -p ${{runner.workspace}}/results/beam-ios-combined/lib
# find ${{runner.workspace}}/results/beam-ios/lib -type f -print0 | while IFS= read -r -d $'\0' file; do lipo -create -output ${{runner.workspace}}/results/beam-ios-combined/lib/$(basename "$file") "$file" ${{runner.workspace}}/results/beam-ios-simulator/lib/$(basename "$file"); done;
# rsync -am --include='*.h' --include='*.hpp' --include='*/' --exclude='*' . ${{runner.workspace}}/results/beam-ios-combined/include/
# ###############################################################################
# # Upload
# ###############################################################################
# - uses: actions/upload-artifact@v2
# with:
# name: beam-ios${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: ${{runner.workspace}}/results/beam-ios
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: beam-ios-simulator${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: ${{runner.workspace}}/results/beam-ios-simulator
# if-no-files-found: error
# - uses: actions/upload-artifact@v2
# with:
# name: beam-ios-combined${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: ${{runner.workspace}}/results/beam-ios-combined
# if-no-files-found: error
# ###############################################################################
# # Build ANDROID
# ###############################################################################
# build_android:
# runs-on: ubuntu-18.04
# # if: ${{false}}
# strategy:
# matrix:
# abi: [x86, x86_64, armeabi-v7a, arm64-v8a]
# env:
# ANDROID_ABI: ${{matrix.abi}}
# ANDROID_SDK_VERSION: 23
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# ###############################################################################
# # Create Build Environment
# ###############################################################################
# - name: Create Build Environment
# run: |
# git clone --depth=1 https://github.com/BeamMW/boost-android.git ${{runner.workspace}}/dependencies/boost_1_68-android
# git clone --depth=1 https://github.com/BeamMW/openssl-android.git ${{runner.workspace}}/dependencies/Prebuilt-OpenSSL-Android
# echo "ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk-bundle" >> $GITHUB_ENV
# echo "BOOST_ROOT_ANDROID=${{runner.workspace}}/dependencies/boost_1_68-android" >> $GITHUB_ENV
# echo "OPENSSL_ROOT_DIR_ANDROID=${{runner.workspace}}/dependencies/Prebuilt-OpenSSL-Android" >> $GITHUB_ENV
# ###############################################################################
# # Configure CMake
# ###############################################################################
# - name: Configure CMake
# run: |
# export PATH=${{env.ANDROID_NDK_HOME}}:$PATH
# cmake -DCMAKE_TOOLCHAIN_FILE=${{env.ANDROID_NDK_HOME}}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=${{env.ANDROID_SDK_VERSION}} -DANDROID_ABI=${{env.ANDROID_ABI}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} .
# ###############################################################################
# # Build
# ###############################################################################
# - name: Build
# run: |
# export PATH=${{env.ANDROID_NDK_HOME}}:$PATH
# make wallet-jni -j$(nproc)
# - name: Save version info
# run: |
# echo "BEAM_VERSION=$(cat beam_version.gen)" >> $GITHUB_ENV
# echo "BEAM_TARGET_SUFFIX=-masternet" >> $GITHUB_ENV
# rm beam_version.gen
# ###############################################################################
# # Upload
# ###############################################################################
# - uses: actions/upload-artifact@v2
# with:
# name: libwallet-jni${{env.BEAM_TARGET_SUFFIX}}-${{env.ANDROID_ABI}}-${{env.BEAM_VERSION}}
# path: |
# android/libwallet-jni.so
# android/com
# if-no-files-found: error
# ###############################################################################
# # Build Key Keeper Web Assembly
# ###############################################################################
# build_key_keeper:
# if: ${{false}} # disabled
# runs-on: ubuntu-18.04
# # if: ${{false}}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# ###############################################################################
# # Create Build Environment
# ###############################################################################
# - name: Download and install emscripten
# shell: bash
# run: |
# git clone https://github.com/emscripten-core/emsdk.git
# cd emsdk
# git pull
# ./emsdk install latest
# ./emsdk activate latest
# - name: Download boost
# shell: bash
# run: |
# git clone --depth=1 https://github.com/BeamMW/boost-linux.git ${{runner.workspace}}/boost_prebuild
# echo "BOOST_ROOT=${{runner.workspace}}/boost_prebuild" >> $GITHUB_ENV
# ###############################################################################
# # Configure CMake
# ###############################################################################
# - name: Configure CMake
# run: |
# source ./emsdk/emsdk_env.sh
# emcmake cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE keykeeper
# ###############################################################################
# # Build
# ###############################################################################
# - name: Build
# run: |
# make -j$(nproc)
# ###############################################################################
# # Upload
# ###############################################################################
# - uses: actions/upload-artifact@v2
# with:
# name: wasm-key-keeper
# path: |
# wasm-key-keeper.*
# if-no-files-found: error
# ###############################################################################
# # Build Web Assembly
# ###############################################################################
# build_wasm:
# runs-on: ubuntu-20.04
# # if: ${{false}}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# ###############################################################################
# # Create Build Environment
# ###############################################################################
# - name: Download and install emscripten
# shell: bash
# run: |
# git clone https://github.com/emscripten-core/emsdk.git ${{runner.workspace}}/emsdk
# cd ${{runner.workspace}}/emsdk
# git pull
# ./emsdk install latest
# ./emsdk activate latest
# - name: Download boost
# shell: bash
# run: |
# git clone --depth=1 https://github.com/BeamMW/boost_prebuild_ubuntu-20.04.git ${{runner.workspace}}/boost_prebuild
# echo "BOOST_INCLUDEDIR=${{runner.workspace}}/boost_prebuild/include" >> $GITHUB_ENV
# echo "BOOST_LIBRARYDIR=${{runner.workspace}}/boost_prebuild/lib/" >> $GITHUB_ENV
# - name: Download openssl
# shell: bash
# run: |
# git clone --depth=1 https://github.com/BeamMW/openssl-wasm.git ${{runner.workspace}}/openssl-wasm
# ###############################################################################
# # Configure CMake && Build
# ###############################################################################
# - name: Configure CMake && Build
# run: |
# source ${{runner.workspace}}/emsdk/emsdk_env.sh
# cmake . -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DBoost_DEBUG=On -DBEAM_TESTS_ENABLED=Off -DBEAM_WALLET_CLIENT_LIBRARY=On -DBEAM_ATOMIC_SWAP_SUPPORT=Off -DBEAM_LASER_SUPPORT=Off -DBEAM_USE_STATIC=On -DBOOST_ROOT=${{runner.workspace}}/boost_prebuild -DCMAKE_FIND_ROOT_PATH:FILEPATH="${{runner.workspace}}/boost_prebuild;${{runner.workspace}}/openssl-wasm" -DOPENSSL_ROOT_DIR=${{runner.workspace}}/openssl-wasm -B${{runner.workspace}}/build_wasm
# emmake make -j$(nproc) -C ${{runner.workspace}}/build_wasm
# - name: Save version info
# run: |
# echo "BEAM_VERSION=$(cat beam_version.gen)" >> $GITHUB_ENV
# echo "BEAM_TARGET_SUFFIX=-masternet" >> $GITHUB_ENV
# rm beam_version.gen
# ###############################################################################
# # Upload
# ###############################################################################
# - uses: actions/upload-artifact@v2
# with:
# name: beam-wasm${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
# path: |
# ${{runner.workspace}}/build_wasm/wasmclient/wasm-client.*
# if-no-files-found: error