-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
91 lines (87 loc) · 4.93 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
stages:
- build
- build2
- deploy
- release
build arm64 aar:
stage: build
image: lbry/android-base:python39
before_script:
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
artifacts:
paths:
- bin/lbrysdk-*-arm64-v8a-release.aar
expire_in: 1 week
script:
- export NEXUS_SIGNING_KEYRING_FILE=$CI_PROJECT_DIR/signing.pgp
- export PATH=/usr/bin:$PATH
- wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls__arm64.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
- cp -f $CI_PROJECT_DIR/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
- cp -Rf $CI_PROJECT_DIR/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- mv buildozer.spec.arm64.ci buildozer.spec
- chmod u+x ./build-release.sh
- ./build-release.sh
- cp $CI_PROJECT_DIR/bin/lbrysdk-$BUILD_VERSION-arm64-v8a-release.aar /dev/null
build arm aar:
stage: build2
image: lbry/android-base:python39
before_script:
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
artifacts:
paths:
- bin/lbrysdk-*-armeabi-v7a-release.aar
expire_in: 1 week
script:
- export NEXUS_SIGNING_KEYRING_FILE=$CI_PROJECT_DIR/signing.pgp
- export PATH=/usr/bin:$PATH
- wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm $CI_PROJECT_DIR/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
- cp -f $CI_PROJECT_DIR/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
- cp -Rf $CI_PROJECT_DIR/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- mv buildozer.spec.arm.ci buildozer.spec
- chmod u+x ./build-release.sh
- ./build-release.sh
- cp $CI_PROJECT_DIR/bin/lbrysdk-$BUILD_VERSION-armeabi-v7a-release.aar /dev/null
deploy build.lbry.io:
image: python:latest
stage: deploy
dependencies:
- build arm aar
- build arm64 aar
before_script:
- pip install awscli
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME__32=lbrysdk-$BUILD_VERSION-armeabi-v7a-release.aar
- export BUILD_APK_FILENAME__64=lbrysdk-$BUILD_VERSION-arm64-v8a-release.aar
script:
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/sdk-build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__64
- aws s3 cp bin/$BUILD_APK_FILENAME__32 s3://build.lbry.io/android/sdk-build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__32
release aar:
image: python:latest
stage: release
only:
- tags
dependencies:
- build arm aar
- build arm64 aar
before_script:
- pip install awscli githubrelease
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME__32=lbrysdk-$BUILD_VERSION-armeabi-v7a-release.aar
- export BUILD_APK_FILENAME__64=lbrysdk-$BUILD_VERSION-arm64-v8a-release.aar
script:
- githubrelease release lbryio/lbry-android-sdk create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME__64 bin/$BUILD_APK_FILENAME__32