forked from Blockstream/gdk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
375 lines (339 loc) · 11.8 KB
/
.gitlab-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
cache:
key: "17"
paths:
- subprojects/packagecache/
image: greenaddress/ci@sha256:6a031d167873f2e305a37de8a89718184b365c29535e62db4293275620d4e803
stages:
- format
- build
- test
- deploy
- publish
.ndk_release:
tags:
- ga
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
expire_in: 1 day
when: on_success
paths:
- gdk-android-jni
.osx_test:
tags:
- osx
cache:
key: "$CI_JOB_NAME"
paths:
- subprojects/packagecache/
.py_release:
tags:
- ga
before_script:
- mkdir $CI_PROJECT_DIR/gdk-python
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
expire_in: 1 day
when: on_success
paths:
- gdk-python
.ios_release:
extends: .osx_test
before_script:
- mkdir $CI_PROJECT_DIR/gdk-iphone
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
expire_in: 1 day
when: on_success
paths:
- gdk-iphone
.ios_sim_release:
extends: .osx_test
before_script:
- mkdir $CI_PROJECT_DIR/gdk-iphone-sim
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
expire_in: 1 day
when: on_success
paths:
- gdk-iphone-sim
test_format:
tags:
- ga
stage: format
script:
- ./tools/format.sh && git diff --exit-code
release_py3m_bullseye:
extends: .py_release
script:
- NUM_JOBS=16 ./tools/build.sh --install $PWD/gdk-python --gcc --python-version 3.9
release_py3m_bullseye_debug:
extends: .py_release
when: manual
script:
- NUM_JOBS=16 ./tools/build.sh --buildtype=debug --install $PWD/gdk-python --gcc --python-version 3.9
release_py3m_ubuntu_18.04:
image: greenaddress/ubuntu_ci@sha256:183cfff276003c28c4388bebbbcc977b1e93f8dc85f1dbf2c02881053ad0c46f
extends: .py_release
script:
- NUM_JOBS=16 ./tools/build.sh --install $PWD/gdk-python --gcc --python-version 3.6
release_py3m_osx:
extends: .py_release
tags:
- osx-ia
script:
- cd $CI_PROJECT_DIR
- python3 -m venv venv
- source venv/bin/activate
- pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --install $PWD/gdk-python --clang --python-version 3.9
release_py3m_osx_m1:
extends: .py_release
tags:
- osx-m1
script:
- cd $CI_PROJECT_DIR
- python3 -m venv venv
- source venv/bin/activate
- pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --install $PWD/gdk-python --clang --python-version 3.9
test_fedora_clang:
image: greenaddress/fedora_ci@sha256:2eb6f59eecc77929e68a8fd50aa1a50bcb394b57df41c3049d976b159ec2abcb
tags:
- ga
script:
- python3 -m pip install virtualenv
- python3 -m virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --clang
test_clang:
tags:
- ga
script:
- NUM_JOBS=16 ./tools/build.sh --clang --enable-tests # REVERTME
- ./build-clang/test_aes_gcm >/dev/null
- ./build-clang/test_json
- ./build-clang/test_networks
gdk_clang_ndk_armeabi-v7a:
extends: .ndk_release
script:
- mkdir gdk-android-jni
- NUM_JOBS=16 JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ANDROID_NDK=/android-ndk-r23b ./tools/build.sh --install $PWD/gdk-android-jni --ndk armeabi-v7a --lto=false
gdk_clang_ndk_arm64-v8a:
extends: .ndk_release
script:
- mkdir gdk-android-jni
- NUM_JOBS=16 JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ANDROID_NDK=/android-ndk-r23b ./tools/build.sh --install $PWD/gdk-android-jni --ndk arm64-v8a --lto=false
gdk_clang_ndk_arm64-v8a-debug:
extends: .ndk_release
when: manual
script:
- mkdir gdk-android-jni
- NUM_JOBS=16 JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ANDROID_NDK=/android-ndk-r23b ./tools/build.sh --buildtype=debug --install $PWD/gdk-android-jni --ndk arm64-v8a --lto=false
gdk_clang_ndk_x86:
extends: .ndk_release
script:
- mkdir gdk-android-jni
- NUM_JOBS=16 JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ANDROID_NDK=/android-ndk-r23b ./tools/build.sh --install $PWD/gdk-android-jni --ndk x86 --lto=false
gdk_clang_ndk_x86_64:
extends: .ndk_release
script:
- mkdir gdk-android-jni
- NUM_JOBS=16 JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ANDROID_NDK=/android-ndk-r23b ./tools/build.sh --install $PWD/gdk-android-jni --ndk x86_64 --lto=false
test_rust:
tags:
- ga
script:
- source /root/.cargo/env
- rustup override set 1.56.0
- git clone https://github.com/ElementsProject/libwally-core
- cd libwally-core && git checkout 88fc78ff72a4f3345fcb87d1c19dc5f6cc5b0e4c && ./tools/autogen.sh && ./configure --enable-debug --prefix=$PWD/build --enable-static --disable-shared --enable-elements --enable-ecmult-static-precomputation && make && make install && cd ..
- export WALLY_DIR=$PWD/libwally-core/build/lib/
- curl -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1n.tar.gz | tar -xvz -C ${PWD}/subprojects
- MESON_SOURCE_ROOT=${PWD} MESON_BUILD_ROOT=${PWD} ${PWD}/tools/buildopenssl.sh
- export OPENSSL_DIR=${PWD}/openssl/build OPENSSL_STATIC=1
- curl -L https://github.com/RCasatta/electrsd/releases/download/electrs_releases/electrs_linux_esplora_703c6a20d52b61a234a18812503bd754d448992a.gz | tar -xvz
- echo "6c62b280db4455a0bee1c60dcb7bb18f741313deb8aafdb7bad1bc2a3f4ff0b8 electrs" | sha256sum --check
- chmod 755 electrs && mv electrs electrs_bitcoin
- export ELECTRS_EXEC=$PWD/electrs_bitcoin
- curl -L https://github.com/RCasatta/electrsd/releases/download/electrs_releases/electrs_linux_esplora_703c6a20d52b61a234a18812503bd754d448992a_liquid.gz | tar -xvz
- echo "47571e09fbc5bc25504e3b66ee47295cea9912182d42721c11d895183e5b6c6e electrs" | sha256sum --check
- chmod 755 electrs && mv electrs electrs_liquid
- export ELECTRS_LIQUID_EXEC=$PWD/electrs_liquid
- curl https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz | tar -xvz bitcoin-0.20.1/bin/bitcoind
- export BITCOIND_EXEC=$PWD/bitcoin-0.20.1/bin/bitcoind
- curl -L https://github.com/ElementsProject/elements/releases/download/elements-0.21.0/elements-elements-0.21.0-x86_64-linux-gnu.tar.gz | tar -xvz elements-elements-0.21.0/bin/elementsd
- export ELEMENTSD_EXEC=$PWD/elements-elements-0.21.0/bin/elementsd
- cd subprojects/gdk_rust
- RUST_LOG=debug RUST_BACKTRACE=1 cargo test -- --nocapture
test_osx_clang:
extends: .osx_test
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --clang --lto=true
release_osx_ios:
extends: .ios_release
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --iphone static --lto=true --install $PWD/gdk-iphone
release_osx_ios_sim:
extends: .ios_sim_release
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --iphonesim static --lto=true --install $PWD/gdk-iphone-sim
release_osx_ios_debug:
extends: .ios_release
when: manual
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --iphone static --lto=false --buildtype=debug --install $PWD/gdk-iphone
release_osx_ios_sim_debug:
extends: .ios_sim_release
when: manual
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ./tools/build.sh --iphonesim static --lto=false --buildtype=debug --install $PWD/gdk-iphone-sim
test_osx_clang_ndk_armeabi-v7a:
only:
refs:
- master
extends: .osx_test
when: manual
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ANDROID_NDK=/opt/android-ndk-r23b ./tools/build.sh --ndk armeabi-v7a
test_osx_clang_ndk_arm64-v8a:
only:
refs:
- master
extends: .osx_test
when: manual
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ANDROID_NDK=/opt/android-ndk-r23b ./tools/build.sh --ndk arm64-v8a
test_osx_clang_ndk_x86:
only:
refs:
- master
extends: .osx_test
when: manual
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ANDROID_NDK=/opt/android-ndk-r23b ./tools/build.sh --ndk x86
test_osx_clang_ndk_x86_64:
only:
refs:
- master
when: manual
extends: .osx_test
script:
- cd $CI_PROJECT_DIR
- ./tools/clean.sh dirs
- virtualenv venv && source venv/bin/activate && pip install -r ./tools/requirements.txt
- NUM_JOBS=16 ANDROID_NDK=/opt/android-ndk-r23b ./tools/build.sh --ndk x86_64
test_windows_mingw_w64_cross:
tags:
- ga
artifacts:
expire_in: 1 hour
when: on_success
paths:
- build-windows-mingw-w64/src/libgreenaddress*
script:
- NUM_JOBS=16 ./tools/build.sh --mingw-w64
apidocs:
tags:
- ga
artifacts:
expire_in: 14 days
when: on_success
paths:
- apidocs.tar.gz
script:
- virtualenv -p python3 .venv
- source .venv/bin/activate
- pip3 install -r docs/requirements.txt
- sphinx-build -b html -a -c docs/source docs/source docs/build/html
- cd docs/build && tar czf ../../apidocs.tar.gz html/ && cd ../..
- deactivate
package_release:
tags:
- garelease
stage: deploy
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_SHORT_SHA"
expire_in: 14 days
paths:
- $CI_PROJECT_DIR/gdk_dist
when: on_success
script:
- cd $CI_PROJECT_DIR
- mkdir gdk-android-symbols
- mkdir gdk_dist
- find gdk-android-jni -name "*.syms" -type f -exec cp --parents {} gdk-android-symbols \;
- tar -czf gdk_dist/gdk-android-symbols.tar.gz gdk-android-symbols --remove-files
- find gdk-android-jni -name "*.a" -type f -delete
- find gdk-android-jni -name "*.syms" -type f -delete
- tar -czf gdk_dist/gdk-android-jni.tar.gz gdk-android-jni --remove-files
- tar -czf gdk_dist/gdk-iphone.tar.gz gdk-iphone --remove-files
- tar -czf gdk_dist/gdk-iphone-sim.tar.gz gdk-iphone-sim --remove-files
- mv gdk-python/*whl gdk_dist/
- cd gdk_dist
- /opt/process_release
dependencies:
- gdk_clang_ndk_armeabi-v7a
- gdk_clang_ndk_arm64-v8a
- gdk_clang_ndk_x86
- gdk_clang_ndk_x86_64
- release_py3m_bullseye
- release_py3m_ubuntu_18.04
- release_py3m_osx
- release_py3m_osx_m1
- release_osx_ios
- apidocs
- release_osx_ios_sim
cp_gcloud:
image: blockstream/gcloud-docker-tf:1.1.7
tags:
- ga
stage: publish
script:
- echo gs://green-gdk-builds/$CI_PROJECT_NAME-$CI_COMMIT_SHA
- TMPF=$(mktemp) || exit 1
- echo $GCLOUD_PUSH_KEY > $TMPF
- export GOOGLE_APPLICATION_CREDENTIALS=$TMPF
- gcloud auth activate-service-account --key-file=$TMPF
- gsutil cp -r $CI_PROJECT_DIR/gdk_dist gs://green-gdk-builds/$CI_PROJECT_NAME-$CI_COMMIT_SHA
dependencies:
- package_release
cp_gcloud_master:
image: blockstream/gcloud-docker-tf:1.1.7
tags:
- ga
stage: publish
only:
refs:
- master
script:
- TMPF=$(mktemp) || exit 1
- echo $GCLOUD_PUSH_KEY > $TMPF
- export GOOGLE_APPLICATION_CREDENTIALS=$TMPF
- gcloud auth activate-service-account --key-file=$TMPF
- gsutil rm -r gs://green-gdk-builds/gdk-master || echo fail # avoid failing when dir does not exist
- gsutil cp -r $CI_PROJECT_DIR/gdk_dist gs://green-gdk-builds/gdk-master
dependencies:
- package_release