-
Notifications
You must be signed in to change notification settings - Fork 292
230 lines (222 loc) · 8.05 KB
/
build-mobile.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: "[Build] Mobile App"
on:
push:
branches:
- main
- develop
# paths:
# - apps/ledger-live-mobile/**
pull_request:
# paths:
# - apps/ledger-live-mobile/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
is-org-member:
name: "Check Org Member"
uses: ledgerhq/ledger-live/.github/workflows/is-org-member.yml@develop
with:
username: ${{ github.actor }}
organisation: ledgerhq
secrets:
token: ${{ secrets.COMMON_READ_ORG }}
start-runner:
needs: [is-org-member]
if: ${{ needs.is-org-member.outputs.is-org-member }}
name: "start ec2 instance"
uses: ledgerhq/ledger-live/.github/workflows/start-linux-runner.yml@develop
with:
instance-type: c5.4xlarge
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
stop-runner:
name: "stop ec2 instance"
if: ${{ always() && needs.start-runner.result == 'success' }}
needs: [start-runner, build-mobile-app-android]
uses: ledgerhq/ledger-live/.github/workflows/stop-linux-runner.yml@develop
with:
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
build-mobile-app-android:
name: "Build Ledger Live Mobile (Android)"
if: ${{ needs.is-org-member.outputs.is-org-member }}
needs: [is-org-member, start-runner]
runs-on: ${{ needs.start-runner.outputs.label }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- name: prepare runner
run: |
sudo growpart /dev/nvme0n1 1
sudo resize2fs /dev/nvme0n1p1
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.event.push.head.sha }}
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- uses: pnpm/action-setup@v2.1.0
with:
version: latest
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm
cache-dependency-path: "**/pnpm-lock.yaml"
- name: bump npm
run: npm i -g npm@8.12.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
env:
ImageOS: ubuntu20
- name: setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: setup Android SDK
uses: android-actions/setup-android@v2.0.6
- name: install dependencies
run: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
- uses: ledgerhq/ledger-live/tools/actions/get-package-infos@develop
id: version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: set beta name
uses: ledgerhq/ledger-live/tools/actions/change-product-name@develop
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(git rev-parse HEAD)"
- name: make local version
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ steps.slug.outputs.sha8 }}
run: cd apps/ledger-live-mobile && npm version $VERSION
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: "yolo"
- name: build the app
env:
ANDROID_KEYSTORE_PASS: staging
ANDROID_KEY_ALIAS: staging
ANDROID_KEY_PASS: staging
NODE_OPTIONS: "--max-old-space-size=7168"
ANDROID_KEYSTORE_FILE: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/staging.kstr
run: pnpm build:llm:android --api="http://127.0.0.1:9080" --token="yolo" --team="foo"
- uses: ledgerhq/ledger-live/tools/actions/get-package-infos@develop
id: post-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: upload Android app
uses: actions/upload-artifact@v3
with:
name: ${{ steps.post-version.outputs.version }}-release
path: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/build/outputs/apk/release
build-mobile-app-android-external:
name: "Build Ledger Live Mobile (Android)"
if: ${{ !needs.is-org-member.outputs.is-org-member }}
needs: [is-org-member]
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.event.push.head.sha }}
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- uses: pnpm/action-setup@v2.1.0
with:
version: latest
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm
cache-dependency-path: "**/pnpm-lock.yaml"
- name: bump npm
run: npm i -g npm@8.12.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
env:
ImageOS: ubuntu20
- name: setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: setup Android SDK
uses: android-actions/setup-android@v2.0.6
- name: install dependencies
run: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
- uses: ledgerhq/ledger-live/tools/actions/get-package-infos@develop
id: version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: set beta name
uses: ledgerhq/ledger-live/tools/actions/change-product-name@develop
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(git rev-parse HEAD)"
- name: make local version
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ steps.slug.outputs.sha8 }}
run: cd apps/ledger-live-mobile && npm version $VERSION
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: "yolo"
- name: build the app
env:
ANDROID_KEYSTORE_PASS: staging
ANDROID_KEY_ALIAS: staging
ANDROID_KEY_PASS: staging
NODE_OPTIONS: "--max-old-space-size=7168"
ANDROID_KEYSTORE_FILE: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/staging.kstr
run: pnpm build:llm:android --api="http://127.0.0.1:9080" --token="yolo" --team="foo"
- uses: ledgerhq/ledger-live/tools/actions/get-package-infos@develop
id: post-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: upload Android app
uses: actions/upload-artifact@v3
with:
name: ${{ steps.post-version.outputs.version }}-release
path: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/build/outputs/apk/release
build-mobile-app-ios:
runs-on: macos-latest
name: "Build Ledger Live Mobile (Mac OS X)"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.event.push.head.sha }}
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- uses: pnpm/action-setup@v2.1.0
with:
version: latest
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm
cache-dependency-path: "**/pnpm-lock.yaml"
- name: bump npm
run: npm i -g npm@8.12.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: install dependencies
run: pnpm i --filter="live-mobile..." --no-frozen-lockfile --unsafe-perm