-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
123 lines (111 loc) · 4.1 KB
/
.travis.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
language: node_js
sudo: true
matrix:
include:
- language: android
dist: trusty
env: NODEJS_VERSION=14 NDK=r18b BUILD_PLATFORM=android CACHE_NAME=android
if: NOT tag IS present OR tag !~ /^(daily)/
android:
components:
- tools
- platform-tools
- build-tools-32.0.0
- android-32
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
jdk: openjdk11
before_install:
- touch $HOME/.android/repositories.cfg
- wget "https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip" -O commandlinetools.zip
- unzip commandlinetools.zip -d $ANDROID_HOME/
- yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager "platforms;android-32" --sdk_root=$ANDROID_HOME
- yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager "build-tools;32.0.0" --sdk_root=$ANDROID_HOME
- wget -q https://services.gradle.org/distributions/gradle-7.1.1-bin.zip
- sudo unzip -q gradle-7.1.1-bin.zip -d $TRAVIS_HOME/gradle/
- export PATH=$TRAVIS_HOME/gradle/gradle-7.1.1/bin:$PATH
- if [[ $TRAVIS_BRANCH == "release2github" ]]; then
BUILD_TYPE=release;
DEPLOY=true;
BUILD_TYPE_ARG="--release";
else
BUILD_TYPE=debug;
BUILD_TYPE_ARG="";
if [[ $TRAVIS_BRANCH == "release2github-debug" ]]; then
DEPLOY=true;
else
DEPLOY="";
fi;
fi;
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
.ci_scripts/checkCommit.sh;
ret=$?;
if [[ "$ret" -ne 1 ]]; then
echo "no commit, do not upload apk!";
DEPLOY="";
else
DEPLOY=true;
fi;
fi
install:
- nvm install ${NODEJS_VERSION}
- npm install -g npm cordova @ionic/cli typescript
script:
- git branch -vv
- git submodule foreach 'git branch -vv'
- if [[ "$DEPLOY" != "" ]]; then
openssl aes-256-cbc -K $encrypted_7cc824b4064e_key -iv $encrypted_7cc824b4064e_iv -in Elastos-Essentials-release.jks.enc -out Elastos-Essentials-release.jks -d;
export COMMITID=$(git log --format=%h -1);
export APPSUFFIX=$(date +'%Y%m%d%H')-$COMMITID;
export TRAVIS_TAG="daily"-$APPSUFFIX;
export APPNAME=Essentials-${APPSUFFIX}.apk;
if [[ $BUILD_TYPE != "release" ]]; then
sed -i "s/ version=\"[0-9d.]*/&.${COMMITID}/" $TRAVIS_BUILD_DIR/App/config.xml;
fi;
fi
- export APK_PATH=$TRAVIS_BUILD_DIR/App/platforms/android/app/build/outputs/apk/$BUILD_TYPE
- $TRAVIS_BUILD_DIR/ToolChains/bin/build all -pf $BUILD_PLATFORM --build $BUILD_TYPE_ARG
- ls -l $APK_PATH
- cd App
- npm list
after_success:
- if [[ "$DEPLOY" != "" ]]; then
cd $APK_PATH;
cp app-${BUILD_TYPE}.apk $APPNAME;
ls -l;
fi
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
# timeout: 1000
cocoapods: true
directories:
- $HOME/.m2
- $HOME/.gradle
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.cocoapods/
notifications:
email:
- raozhiming@trinity-tech.io
- benjaminpiette@elastos-fusion.org
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name $USER_NAME
- git config --local user.email $USER_EMAIL
- git tag $TRAVIS_TAG
deploy:
provider: releases
api_key: $GIT_TOKEN
file_glob: true
file: Essentials*.apk
skip_cleanup: true
prerelease: true
on:
condition: $DEPLOY != ""
all_branches: true
env:
global:
- secure: iirP58whyuJHukzqSzNNTpRco8r6qRR8M/ZtRD8PB49ZuU+4c+x1TFIQJ0KzGo6C9QaXc+vWkQv2NtDM7Lz9chKPWDQE1R/msjvQ/qfeFwkzzMAeGhejimnTRFyikJa9u+qX9F0O18/GGPFWmxRVamC+7zM/9xmX67iOzrUHj82lHw7P5Uyc9DZvI1XNUOpd0KanGRE7THA79z0I5XmNNpgCJcd+s7bqQeHUGMMwYGNGOSo2ibo4/Av4UUR1Jnr5kFvQ9om4G/AgPNLik9x9fhGAHjjUTrI7YAU8feXRMySXxdXD8eoLUkKm0/4DbQYTypWuqgD4JehwMrSriRBUwvKnObX1Q2SP/87xGvUFlxgjTj8EoCQVI8YazTEIgSoN6LA92SdSYQlej4ZQh9OKj59Xvpxky1A5HBJyU++qlPUFjYa7pBOLeV4Aq2jbdP+0UCRA6AEuFHSVu/Wl7oZmg43yN1AeeY8t9jwKODe1guFVARdCARKOR1vMfFHqXw5nD06OUPrXgySZTfFLVm8UUqS/NCLvGMMVS984lH/MQqyxNrjgwaDbrzMt1V9947YFmnDc1q2C8zNHWHwYwr1WFJsbSk72WTaYoZTQXWnhOsaDc10pIYeFTmiQknvyMCztzgAVgn8k9gJD/LZYyLH6+2v7Rdavh2Kg/EN41kem6BQ=