-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
119 lines (111 loc) · 3.88 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
matrix:
include:
- os: osx
osx_image: xcode11.3
language: node_js
node_js: "18"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILD_BACHE=$HOME/.cache/electron-builder
deploy:
provider: releases
api_key: ${GITHUB_API_KEY}
file: rdzSonde-v${TRAVIS_TAG}.dmg
skip_cleanup: true
overwrite: true
on:
tags: true
# - os: windows
# language: node_js
# node_js: "12"
# env:
# - ELECTRON_CACHE=$HOME/.cache/electron
# - ELECTRON_BUILD_BACHE=$HOME/.cache/electron-builder
# deploy:
# provider: releases
# api_key: ${GITHUB_API_KEY}
# file: rdzSonde-setup-${TRAVIS_TAG}.exe
# skip_cleanup: true
# overwrite: true
# on:
# tags: true
# - os: linux
# language: minimal
# dist: focal
# group: edge
# deploy:
# provider: releases
# api_key: ${GITHUB_API_KEY}
# file: rdzSonde-${TRAVIS_TAG}.apk
# skip_cleanup: true
# overwrite: true
# on:
# tags: true
#
env:
global:
# for updates check developer.android.com/studio#downloads (current 26.1.1)
- ANDROID_SDK_TOOLS=commandlinetools-linux-7302050_latest.zip
- JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
cache:
directories:
- mode_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
before_script:
#- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
# - emulator -avd test -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
# - curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
npm install -g cordova;
cordova platform add electron;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
sudo npm install -g cordova;
cordova platform add electron;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
echo ${TEST};
sudo apt-get update;
sudo apt-get install nodejs;
sudo apt-get install npm;
sudo apt-get install openjdk-11-jdk;
sudo apt-get install gradle;
wget -nv https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS;
unzip -q $ANDROID_SDK_TOOLS -d $HOME/sdk;
mv $HOME/sdk/cmdline-tools $HOME/sdk/latest;
mkdir $HOME/sdk/cmdline-tools;
mv $HOME/sdk/latest $HOME/sdk/cmdline-tools/;
export PATH=$PATH:$HOME/sdk/cmdline-tools/latest/bin;
export ANDROID_SDK_ROOT=$HOME/sdk;
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platforms;android-29";
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "emulator" "tools" "platform-tools";
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT --licenses;
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "build-tools;29.0.3";
sudo npm install -g cordova;
sudo chown -R 2000:2000 "/home/travis/.npm";
cordova platform add android;
perl -pi -e 's/1\.8\.x/11.x/' ./platforms/android/cordova/lib/check_reqs.js;
fi
script:
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
echo "Windows";
cordova build electron --debug;
find platforms;
mv platforms/electron/build/*.exe rdzSonde-setup-${TRAVIS_TAG}.exe;
ls *.exe;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
echo "OSX";
cordova build electron --release;
mv platforms/electron/build/rdzSonde*.dmg rdzSonde-v${TRAVIS_TAG}.dmg;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cordova build --release;
export BUILD_TOOLS=$HOME/sdk/build-tools/29.0.3;
${BUILD_TOOLS}/zipalign -v -p 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk rdzSonde-unsigned.apk;
echo ${SUPERSECRET} | gpg --batch --yes --passphrase-fd 0 -d my-release-key.jks.gpg > my-release-key.jks;
echo ${JKSPASS} | ${BUILD_TOOLS}/apksigner sign --ks my-release-key.jks --out rdzSonde-${TRAVIS_TAG}.apk rdzSonde-unsigned.apk;
fi