-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
90 lines (81 loc) · 1.91 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
sudo: required
env:
global:
- TRAVIS_NODE_VERSION=10
- ANDROID_API_LEVEL=27
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
- DIST_FOLDER=dist
_ios: &_ios
language: node_js
node_js: 10
os: osx
osx_image: xcode10.2
_android: &_android
language: android
os: linux
addons:
apt:
packages:
- ant
android:
components:
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
- extra-android-m2repository
- extra-android-support
- extra-google-m2repository
licenses:
- "android-sdk-license.*"
matrix:
include:
- env: PLATFORM=android
<<: *_android
# - env:
# - PLATFORM=ios
# - IOS_APPLE_ID=YOUR_APPLE_ID
# - IOS_PP=YOUR_IOS_PP
# <<: *_ios
cache:
directories:
- node_modules
- platforms
- plugins
before_install:
# Add yarn dependencies.
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
- nvm install $TRAVIS_NODE_VERSION
- nvm use $TRAVIS_NODE_VERSION
- curl -o- -L https://yarnpkg.com/install.sh | bash
- source ~/.bashrc
- node -v && npm -v && yarn -v
install:
- if [[ "$PLATFORM" == android ]]; then
npm install -g cordova@9 &&
cordova -v
else
npm install -g cordova@9 &&
cordova -v;
fi
script:
- yarn
- yarn build
- mkdir $DIST_FOLDER
- if [[ "$PLATFORM" == android ]]; then
yarn release:android &&
mv ./platforms/android/app/build/outputs/apk/release/app-release.apk $DIST_FOLDER/whu-library-seat-mobile_$TRAVIS_TAG.apk;
else
rvm use system &&
yarn release:ios &&
mv "./platforms/ios/build/emulator/whu-library-seat-mobile.app" $DIST_FOLDER/whu-library-seat-mobile_$TRAVIS_TAG.app;
fi
deploy:
provider: releases
skip-cleanup: true
overwrite: true
draft: true
api_key: $GH_TOKEN
file_glob: true
file: $DIST_FOLDER/whu-library-seat-mobile_*
on:
tags: true