-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
175 lines (162 loc) · 7.53 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
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
171
172
173
174
175
branches:
only:
- develop
- master
matrix:
include:
- name: 'JS lint, test, i18n, and Codepush'
language: node_js
node_js:
- '14'
before_install:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p # Fix node file watchers issue https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-458769756
before_script:
- echo "TRAVIS_COMMIT=$TRAVIS_COMMIT" >> ./.env.production
- |
if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "develop" ]; then
echo "Setting ENVFILE to .env.production"
export ENVFILE=.env.production
else
echo "Setting ENVFILE to .env.staging"
export ENVFILE=.env.staging
fi
script:
- yarn gql:codegen
- yarn gql:schema
- travis_wait yarn test:coverage --maxWorkers=4 --ci --silent
- yarn lint
- yarn lint:ts
- yarn prettier:check
notifications:
email: false
after_success:
- bash <(curl -s https://codecov.io/bash)
- |
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
yarn onesky:upload;
yarn onesky:download;
yarn codepush-ios-staging --token "$APPCENTER_TOKEN" --sourcemap-output sourcemap.ios.js --extra-bundler-option="--sourcemap-sources-root" --extra-bundler-option="./" --description "#$TRAVIS_BUILD_NUMBER $TRAVIS_COMMIT_RANGE | $TRAVIS_COMMIT_MESSAGE" -t `sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./ios/MissionHub.xcodeproj/project.pbxproj`; # Codepush can't figure out how to parse MARKETING_VERSION https://github.com/microsoft/react-native-code-push/issues/1665 https://stackoverflow.com/a/58769925/665224
yarn codepush-android-staging --token "$APPCENTER_TOKEN" --sourcemap-output sourcemap.android.js --extra-bundler-option="--sourcemap-sources-root" --extra-bundler-option="./" --description "#$TRAVIS_BUILD_NUMBER $TRAVIS_COMMIT_RANGE | $TRAVIS_COMMIT_MESSAGE";
curl https://api.rollbar.com/api/1/sourcemap \
-F access_token=$ROLLBAR_POST_SERVER_ITEM_TOKEN \
-F version=$TRAVIS_COMMIT.ios \
-F minified_url=http://reactnativehost/main.jsbundle \
curl https://api.rollbar.com/api/1/sourcemap \
-F access_token=$ROLLBAR_POST_SERVER_ITEM_TOKEN \
-F version=$TRAVIS_COMMIT.android \
-F minified_url=http://reactnativehost/main.jsbundle \
fi
cache:
- yarn
- name: 'iOS Testflight Build'
if: branch = master and type = push
language: objective-c
os: osx
osx_image: xcode11.4
gemfile: ios/Gemfile
podfile: ios/Podfile
xcode_workspace: ios/MissionHub.xcworkspace
env:
- ENVFILE=.env.production
before_install:
- rm -rf ~/.nvm # remove nvm in favor of node from brew
# - brew update
# - brew upgrade node
- brew install yarn watchman
# Add github.com to known hosts
- echo "|1|k558lsi/DjLSDmo7uuIkNh044tk=|5+j2j24lzaSraqO8s9cHHdk/vvI= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
install:
- yarn
- echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc
- (cd ios && bundler install)
before_script:
- echo "TRAVIS_COMMIT=$TRAVIS_COMMIT" >> ./.env.production
- yarn run onesky:download
- yarn gql:codegen
- yarn gql:schema
script:
- (cd ios && fastlane ios beta)
# - (cd ios && travis_wait 30 fastlane ios beta)
before_cache:
- brew cleanup
cache:
- yarn
- cocoapods
- bundler
- directories:
- $HOME/Library/Developer/Xcode/DerivedData
- $HOME/Library/Caches/Homebrew
- name: 'Android Beta Build'
language: android
dist: trusty
android:
components:
- tools
- build-tools-28.0.3
- platform-tools
- tools
- android-28
- extra-google-google_play_services
licenses:
- android-sdk-license-.+
if: branch = master and type = push
env:
- ENVFILE=.env.production
before_install:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p # Fix node file watchers issue https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-458769756
- rvm install 2.6.3
- gem install bundler
- git fetch --unshallow
- openssl aes-256-cbc -pass "pass:$GOOGLE_PLAY_API_FILE_PASSWORD" -in ./android/fastlane/GooglePlayAPI.enc -out ./android/fastlane/GooglePlayAPI.json -d -a
- curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
- sudo apt-get install nodejs -y
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- echo yes | sdkmanager "build-tools;28.0.3" # Android platform required by app
- echo yes | sdkmanager "build-tools;25.0.3" # Android platform required by some dependency
- echo yes | sdkmanager "build-tools;23.0.1" # Android platform required by some dependency
# Add github.com to known hosts
- echo "|1|k558lsi/DjLSDmo7uuIkNh044tk=|5+j2j24lzaSraqO8s9cHHdk/vvI= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
install:
- yarn install
- (cd android && bundler install)
before_script:
- echo "TRAVIS_COMMIT=$TRAVIS_COMMIT" >> ./.env.production
- yarn run onesky:download
- yarn gql:codegen
- yarn gql:schema
script:
- (cd android && fastlane android beta)
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
- yarn
- bundler
- directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
- name: 'Fastlane release'
language: objective-c
xcode_workspace: ios/MissionHub.xcworkspace
os: osx
osx_image: xcode11.4
if: tag =~ ^v\d+\.\d+\.\d+(-ios|-android)?$
before_install:
- openssl aes-256-cbc -pass "pass:$GOOGLE_PLAY_API_FILE_PASSWORD" -in ./android/fastlane/GooglePlayAPI.enc -out ./android/fastlane/GooglePlayAPI.json -d -a
- brew update
- brew upgrade node
- brew install yarn
install:
- yarn
- (cd ios && bundler install)
- (cd android && bundler install)
script:
- (cd ios && fastlane ios release submit:false auto_release:false)
- (cd android && fastlane android release)
cache:
- bundler
- yarn