-
Notifications
You must be signed in to change notification settings - Fork 210
418 lines (363 loc) · 17 KB
/
atomicdex-desktop-ci.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
name: komodo-wallet-desktop CI
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches:
- master
schedule:
- cron: '0 0 * * 1'
env:
DEX_API: "mm2"
DEX_RPCPORT: 7762
DEX_RPC: "http://127.0.0.1:7762"
DEX_PROJECT_NAME: "komodo-wallet"
DEX_DISPLAY_NAME: "Komodo Wallet"
DEX_COMPANY: "KomodoPlatform"
DEX_VERSION: "0.7.0"
DEX_WEBSITE: "https://atomicdex.io/"
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
RUNVCPKG_VCPKG_ROOT: ${{ github.workspace }}\komodo-wallet-desktop\ci_tools_atomic_dex\vcpkg-repo
VCPKG_ROOT: ${{ github.workspace }}\komodo-wallet-desktop\ci_tools_atomic_dex\vcpkg-repo
jobs:
ci-flow:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-release,
ubuntu-debug,
osx-release,
osx-debug,
windows-release,
windows-debug
]
include:
- name: ubuntu-release
os: ubuntu-20.04
qt: '5.15.2'
type: 'Release'
host: 'linux'
- name: ubuntu-debug
os: ubuntu-20.04
qt: '5.15.2'
type: 'Debug'
host: 'linux'
- name: osx-release
os: macos-12
qt: '5.15.2'
type: 'Release'
host: 'mac'
- name: osx-debug
os: macos-12
qt: '5.15.2'
type: 'Debug'
host: 'mac'
- name: windows-release
os: windows-latest
qt: '5.15.2'
type: 'Release'
host: 'windows'
- name: windows-debug
os: windows-latest
qt: '5.15.2'
type: 'Debug'
host: 'windows'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: 'true'
- name: Expose GitHub Runtime Env
uses: crazy-max/ghaction-github-runtime@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.12.0
- name: Build libwally (Windows)
if: runner.os == 'Windows'
run: |
cd '${{ github.workspace }}'
git clone -b v0.8.5 --recurse-submodules https://github.com/KomodoPlatform/libwally-core.git
cd '${{ github.workspace }}\libwally-core'
git submodule init
git submodule sync --recursive
git submodule update --init --recursive
$env:LIBWALLY_DIR='${{ github.workspace }}\libwally-core'
"$env:LIBWALLY_DIR\tools\msvc\gen_ecmult_static_context.bat"
copy src\ccan\ccan\str\hex\hex.c src\ccan\ccan\str\hex\hex_.c
copy src\ccan\ccan\base64\base64.c src\ccan\ccan\base64\base64_.c
cl /utf-8 /DUSE_ECMULT_STATIC_PRECOMPUTATION /DECMULT_WINDOW_SIZE=15 /DWALLY_CORE_BUILD /DHAVE_CONFIG_H /DSECP256K1_BUILD /I$env:LIBWALLY_DIR\src\wrap_js\windows_config /I$env:LIBWALLY_DIR /I$env:LIBWALLY_DIR\src /I$env:LIBWALLY_DIR\include /I$env:LIBWALLY_DIR\src\ccan /I$env:LIBWALLY_DIR\src\ccan\base64 /I$env:LIBWALLY_DIR\src\secp256k1 /Zi /LD src/aes.c src/anti_exfil.c src/base58.c src/base64.c src/bech32.c src/bip32.c src/bip38.c src/bip39.c src/blech32.c src/ecdh.c src/elements.c src/hex.c src/hmac.c src/internal.c src/mnemonic.c src/pbkdf2.c src/pullpush.c src/psbt.c src/script.c src/scrypt.c src/sign.c src/symmetric.c src/transaction.c src/wif.c src/wordlist.c src/ccan/ccan/crypto/ripemd160/ripemd160.c src/ccan/ccan/crypto/sha256/sha256.c src/ccan/ccan/crypto/sha512/sha512.c src/ccan/ccan/base64/base64_.c src\ccan\ccan\str\hex\hex_.c src/secp256k1/src/secp256k1.c src/secp256k1/src/precomputed_ecmult_gen.c src/secp256k1/src/precomputed_ecmult.c /Fewally.dll
Copy-Item "${{ github.workspace }}\libwally-core\wally.dll" -Destination "${{ github.workspace }}\wally\wally.dll" -force
- name: Install QT (macOS)
if: runner.os == 'macOS'
uses: jurplel/install-qt-action@v3.3.0
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: '${{ github.workspace }}'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
setup-python: 'false'
cache: true
- name: Install QT (Linux)
if: runner.os == 'Linux'
uses: jurplel/install-qt-action@v3.3.0
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: '${{ github.workspace }}'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
setup-python: 'false'
cache: true
- name: Install QT (Windows)
if: runner.os == 'Windows'
uses: jurplel/install-qt-action@v3.3.0
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: 'C:\'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
arch: 'win64_msvc2019_64'
cache: true
- name: Install nim (Linux)
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
export SHELL=/bin/bash
echo "CHOOSENIM_CHOOSE_VERSION=1.6.2" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.6.2
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
chmod +x choosenim.sh
./choosenim.sh -y
export PATH=/home/runner/.nimble/bin:$PATH
chmod +x /home/runner/.choosenim/toolchains/nim-1.6.2/bin/*
- name: Install nim (MacOS)
if: runner.os == 'macOS'
run: |
echo "CHOOSENIM_CHOOSE_VERSION=1.6.2" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.6.2
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
chmod +x choosenim.sh
./choosenim.sh -y
export PATH=/Users/runner/.nimble/bin:$PATH
chmod +x /Users/runner/.choosenim/toolchains/nim-1.6.2/bin/*
- name: Install deps (Linux)
if: runner.os == 'Linux'
run: |
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo ${{ github.sha }}
sudo ./ci_tools_atomic_dex/ci_scripts/linux_script.sh
- name: Install deps (MacOS)
if: runner.os == 'macOS'
run: |
./ci_tools_atomic_dex/ci_scripts/osx_script.sh
- name: Upload env variable for vpkg (MacOS)
if: runner.os == 'macOS'
run: |
echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV
echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV
- name: Upload env variable for vpkg (Linux)
if: runner.os == 'Linux'
run: |
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "CC=clang-12" >> $GITHUB_ENV
- name: vcpkg deps (All)
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
vcpkgJsonGlob: 'vcpkg.json'
- name: import code signing certificates (macos)
if: runner.os == 'macOS' && 'KomodoPlatform/komodo-wallet-desktop' == github.repository
uses: Apple-Actions/import-codesign-certs@v1
with:
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: import installer code signing certificates (macos)
if: runner.os == 'macOS' && 'KomodoPlatform/komodo-wallet-desktop' == github.repository
uses: apple-actions/import-codesign-certs@v1
with:
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
create-keychain: false
p12-file-base64: ${{ secrets.CERTIFICATES_INSTALLER_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build Komodo Wallet (MacOS)
if: runner.os == 'macOS'
run: |
xcrun --sdk macosx --show-sdk-path
export SDK_PATH=$(xcrun --sdk macosx --show-sdk-path)
ls /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
echo $HOME/sdk
ls $HOME/sdk
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export ASC_PUBLIC_ID="${{ secrets.ASC_PUBLIC_ID }}"
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=/Users/runner/.nimble/bin:$PATH
export MACOSX_DEPLOYMENT_TARGET=10.15
export CC=clang
export CXX=clang++
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex bundle ${{ matrix.type }} --osx_sdk=$HOME/sdk/MacOSX10.15.sdk --compiler=clang++
- name: Build Komodo Wallet (Linux)
if: runner.os == 'Linux'
run: |
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex build ${{ matrix.type }}
./ci_tools_atomic_dex bundle ${{ matrix.type }}
- name: Build Komodo Wallet (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
$Env:QT_VERSION = "${{ matrix.qt }}"
$Env:CMAKE_BUILD_TYPE = "${{ matrix.type }}"
.\ci_tools_atomic_dex\ci_scripts\windows_script.ps1
- name: Upload env variable for artifacts (Linux)
if: runner.os == 'Linux'
run: |
echo "artifact_name_zstd=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).tar.zst" >> $GITHUB_ENV
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "artifact_name_appimage=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
echo "target_name_zstd=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD).tar.zst" >> $GITHUB_ENV
echo "target_name_zip=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "target_name_appimage=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
- name: Upload bundle artifact (Linux ZSTD)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zstd }}
path: ./bundled/linux/${{ env.target_name_zstd }}
retention-days: 7
- name: Upload bundle artifact (Linux ZIP)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/linux/${{ env.target_name_zip }}
retention-days: 7
- name: Upload bundle artifact (Linux AppImage)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_appimage }}
path: ./bundled/linux/${{ env.target_name_appimage }}
retention-days: 7
- name: Upload env variable for artifacts (macOS)
if: runner.os == 'macOS'
run: |
echo "artifact_name_dmg=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).dmg" >> $GITHUB_ENV
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-installer-${{ matrix.name }}-$(git rev-parse --short HEAD).7z" >> $GITHUB_ENV
- name: Upload artifacts (MacOS dmg)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_dmg }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}.dmg
retention-days: 7
- name: Upload artifacts (MacOS installer)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}_installer.7z
retention-days: 7
- name: Upload env variable for artifacts (Windows)
if: runner.os == 'Windows'
run: |
echo "on_windows"
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-installer-$(git rev-parse --short HEAD).exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload artifacts (Windows zip)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}.zip
retention-days: 7
- name: Upload artifacts (Windows installer)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}_installer.exe
retention-days: 7
- name: Running Tests (Linux)
working-directory: ci_tools_atomic_dex
continue-on-error: true
if: runner.os == 'Linux' && 'KomodoPlatform/komodo-wallet-desktop' == github.repository
run: |
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
export CXX=clang++-12
export CC=clang-12
#echo "Running tests"
#./ci_tools_atomic_dex tests ${{ matrix.type }}
#cd build-${{ matrix.type }}/bin/AntaraAtomicDexTestsAppDir/usr/bin
#cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
- name: Running Tests (MacOS)
working-directory: ci_tools_atomic_dex
continue-on-error: true
if: runner.os == 'macOS' && 'KomodoPlatform/komodo-wallet-desktop' == github.repository
run: |
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export ASC_PUBLIC_ID="${{ secrets.ASC_PUBLIC_ID }}"
export MACOSX_DEPLOYMENT_TARGET=10.13
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=/Users/runner/.nimble/bin:$PATH
export CC=clang
export CXX=clang++
#echo "Running tests"
#nimble build -y
#./ci_tools_atomic_dex tests ${{ matrix.type }}
#cd build-${{ matrix.type }}/bin/${{ env.DEX_PROJECT_NAME }}_tests.app/Contents/MacOS
#cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
- name: Running Tests (Windows)
shell: powershell
continue-on-error: true
if: runner.os == 'Windows' && 'KomodoPlatform/komodo-wallet-desktop' == github.repository
run: |
#echo "Running tests"
$Env:REPORT_CI_TOKEN = "${{ secrets.REPORT_CI_TOKEN_SECRET }}"
$Env:QT_INSTALL_CMAKE_PATH = "C:\Qt\${{ matrix.qt }}\msvc2019_64"
#cd b\bin
#./${{ env.DEX_PROJECT_NAME }}_tests.exe --reporters=xml --out=${{ env.DEX_PROJECT_NAME }}-tests-result.xml -s
#Invoke-WebRequest -Uri https://report.ci/upload.py -OutFile upload.py
#python upload.py --sha $(git rev-parse HEAD) -n "[Doctest Windows]" --include='${{ env.DEX_PROJECT_NAME }}-tests-result.xml' --framework=doctest --merge ".*"