-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
170 lines (159 loc) · 3.75 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
stages:
- test
- build
- release
eslint:
image: node:14.0.0
stage: test
tags:
- docker
script:
- yarn install --quiet
- yarn run lint
flow:
image: node:14.0.0
stage: test
tags:
- docker
script:
- yarn install --quiet
- yarn run flow
jest:
image: node:14.0.0
stage: test
tags:
- docker
script:
- echo "module.exports = {localStorageKey:'tellduslive'}" > config.local.js
- yarn install --quiet
- yarn test
android: &android
image: telldus/react-native-android:29-alpine
stage: build
variables:
DEPLOY_STORE: ${CI_JOB_NAME}
cache:
paths:
- node_modules
- android/gradle
artifacts:
paths:
- android/app/build/outputs/bundle/release/app-release.aab
- android/app/build/outputs/apk/release/app-release.apk
- android/android_sourcemap.js
- android/huawei_sourcemap.js
- android/universal.apks
expire_in: '1 mos'
script:
- $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*
- yarn install --quiet
- yarn run manage:translations-widget-android
- cd android
- ./buildGitlabRunner.sh
only:
- tags
- master
- /^v\d+\.\d+.*$/ # Version branches
tags:
- android
huawei:
<<: *android
ios:
stage: build
tags:
- macos
- xcode-11.2
cache:
paths:
- node_modules
artifacts:
paths:
- ios/main.jsbundle.map
- TelldusLiveApp.ipa
- TelldusLiveApp.app.dSYM.zip
expire_in: '1 mos'
only:
- tags
- master
- /^v\d+\.\d+.*$/ # Version branches
script:
- $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*
- yarn install --quiet
- cd ios
- ./buildGitlabRunner.sh
google_play:
image: ruby:2
stage: release
tags:
- docker
dependencies:
- android
environment:
name: google_play
url: https://play.google.com/store/apps/details?id=com.telldus.live.mobile.test
only:
- tags
script:
- echo ${GOOGLE_KEY} > play_key.json
- bundle install
- fastlane android alpha --verbose
huawei_app_gallery:
image: ruby:2
stage: release
variables:
DEPLOY_STORE: huawei
tags:
- docker
dependencies:
- huawei
environment:
name: huawei_app_gallery
url: https://huaweimobileservices.com/appgallery/
only:
- tags
script:
- apt-get update && apt-get install -y locales >/dev/null
- echo "en_US UTF-8" > /etc/locale.gen
- locale-gen en_US.UTF-8
- export LANG=en_US.UTF-8
- export LANGUAGE=en_US:en
- export LC_ALL=en_US.UTF-8
- bundle install
- bundle exec fastlane android huawei --verbose
testflight: &testflight
stage: release
tags:
- macos
dependencies:
- ios
environment:
name: appstore
url: https://itunes.apple.com/us/app/telldus-live-mobile-beta/id1014419677
only:
- tags
script:
- fastlane ios beta --verbose
- yarn install --quiet
- fastlane ios refresh_dsyms --verbose
testflight (master):
<<: *testflight
when: manual
only:
- master
s3:
image: cgswong/aws:latest
stage: release
dependencies:
- ios
- android
- huawei
environment:
name: s3
url: https://download.telldus.com/app
only:
- tags
script:
- echo "${S3CFG}" > ~/.s3cfg
- s3cmd put android/android_sourcemap.js android/app/build/outputs/bundle/release/app-* android/universal.apks s3://download.telldus.com/app/${CI_COMMIT_TAG}/telldus-app-v3_android_${CI_COMMIT_TAG}/
- s3cmd put android/huawei_sourcemap.js android/app/build/outputs/apk/release/app-* s3://download.telldus.com/app/${CI_COMMIT_TAG}/telldus-app-v3_huawei_${CI_COMMIT_TAG}/
- s3cmd put ios/main.jsbundle.map TelldusLiveApp.ipa s3://download.telldus.com/app/${CI_COMMIT_TAG}/telldus-app-v3_ios_${CI_COMMIT_TAG}/