-
Notifications
You must be signed in to change notification settings - Fork 9
212 lines (173 loc) · 6.65 KB
/
dev.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
on:
push:
branches:
- master
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
KEYCHAIN_TOKEN: ${{ secrets.KEYCHAIN_TOKEN }}
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
name: Beta build & deploy
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: "14.x"
- name: Create version tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
BUILD=$(git rev-list --count $GITHUB_SHA)
VERSION=$(node -e "p=require('./package.json');console.log(p.version)")
TAG_NAME="v${VERSION}.${BUILD}"
curl --request POST \
--url https://api.github.com/repos/moonlet/wallet-app/git/refs \
--header "authorization: token $GITHUB_TOKEN" \
--header "content-type: application/json" \
--data "{\"ref\": \"refs/tags/$TAG_NAME\",\"sha\": \"$GITHUB_SHA\"}"
- name: Cache node modules
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock', 'package.json') }}
- name: Yarn install
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
- name: Generate icons
run: yarn run generate-icons
- name: Generate firebase web config file
run: |
echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
- name: Run unit tests
run: yarn test
- name: Upload coverage to Codecov
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run: |-
curl -s https://codecov.io/bash | bash -s -- \
-F "unittests" \
-Z || echo 'Codecov upload failed'
- name: Sentry release setup
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: moonlet
run: |-
BUILD=$(git rev-list --count $GITHUB_SHA)
VERSION=$(node -e "p=require('./package.json');console.log(p.version)")
npx sentry-cli releases new "com.moonlet.beta@$VERSION+$BUILD" -p wallet-app-android -p wallet-app-ios -p wallet-extension -p beta-app-android -p beta-app-ios -p beta-extension
npx sentry-cli releases set-commits "com.moonlet.beta@$VERSION+$BUILD" --auto
beta-android:
name: Android app
runs-on: ubuntu-latest
# needs: unit-tests
steps:
# - name: Install Java 11.0.20
# uses: actions/setup-java@v3
# with:
# java-version: '11.0.20'
# distribution: adopt
# architecture: x64
- name: Increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Checkout
uses: actions/checkout@v1
- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: "16.x"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
- name: Generate firebase config file
run: |
echo '${{ secrets.FB_CONFIG_ANDROID_BETA }}' > android/app/google-services.json
echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
- name: Setup key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_CERTS }}
- name: Add to host
run: ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- name: Dependencies install
run: cd android && bundle install
- name: Cache node modules
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock', 'package.json') }}
# key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Yarn install
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
- name: Get sign ssh-keys
run: cd android/app && git clone [email protected]:moonlet/moonlet-playstore-key.git
- name: Generate fonts and icons
run: yarn run generate-icons
- name: Run fastlane beta
run: cd android/fastlane && bundle exec fastlane beta
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
NODE_OPTIONS: --max_old_space_size=4096
NODE_ENV: production
# beta-ios:
# name: iOS app
# runs-on: macos-latest
# needs: unit-tests
# steps:
# - name: Setup xcode
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest-stable
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup nodejs
# uses: actions/setup-node@v3
# with:
# node-version: "14.x"
# - name: Setup key
# uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.SSH_CERTS }}
# - name: Add to host
# run: ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
# - name: Generate firebase config file
# run: |
# echo '${{ secrets.FB_CONFIG_IOS_BETA }}' > ios/GoogleService-Info.plist
# echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
# echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
# - name: Generate p8 File
# run: |
# echo '${{ secrets.APPSTORE_CONNECT_FILE_KEY }}' > ios/AuthKey.p8
# - name: Dependencies install
# run: cd ios && bundle install
# - name: Cache node modules
# uses: actions/cache@v2
# id: cache
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock', 'package.json') }}
# - name: Install dependencies
# if: steps.cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Cocoapods install
# run: cd ios && pod install
# - name: Generate fonts and icons
# run: yarn run generate-icons
# - name: Run fastlane beta
# run: cd ios/fastlane && bundle exec fastlane beta
# env:
# NODE_ENV: production