This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 301
322 lines (312 loc) · 11.7 KB
/
bundle-app.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: "Tests | Bundle App"
on:
pull_request:
branches:
- develop
- master
push:
branches:
- develop
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-if-fork:
runs-on: ubuntu-20.04
outputs:
forked: ${{ steps.forked.outputs.forked }}
steps:
- name: echo
run: |
echo ${{github.event.pull_request.head.repo.full_name }}
echo ${{ github.repository }}
- name: check if we are on a forked repo
id: forked
run: echo "::set-output name=forked::$(${{github.event.pull_request.head.repo.full_name != github.repository }})"
bundle-macos:
name: "[macOS] Build"
runs-on: [ledger-live, macos]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- uses: actions/setup-node@main
with:
node-version: 14.x
- name: install yarn
run: npm i -g yarn
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- uses: ledgerhq/actions/packages/has-hash-commit-deps@main
id: has-hash-commit-deps
with:
workspace: ${{ github.workspace }}
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'true' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000 --network-concurrency 1
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'false' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/packages/get-package-infos@main
id: version
with:
path: ${{ github.workspace }}
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: make local version pr
if: github.event_name == 'pull_request'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.event.pull_request.head.sha }}
run: yarn version --new-version="$VERSION"
- name: make local version push
if: github.event_name == 'push'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.sha }}
run: yarn version --new-version="$VERSION"
- name: build the app
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
run: yarn build-ci
- uses: ledgerhq/actions/packages/get-package-infos@main
id: post-version
with:
path: ${{ github.workspace }}
- name: upload macOS app
uses: actions/upload-artifact@v1
with:
name: ${{ steps.post-version.outputs.version }}-mac.dmg
path: dist/${{ steps.post-version.outputs.name }}-${{ steps.post-version.outputs.version }}-mac.dmg
clean-macos-runner:
runs-on: [ledger-live, macos]
needs: [bundle-macos]
steps:
- name: Clean working directory
run: |
cd $RUNNER_WORKSPACE
cd ..
rm -r *
start-runner:
name: "[Runner] start ec2 instance"
needs: check-if-fork
if: ${{ !needs.check-if-fork.outputs.forked && github.actor != 'dependabot[bot]' }}
uses: ledgerhq/actions/.github/workflows/start-linux-runner.yml@main
with:
instance-type: c5.4xlarge
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
stop-runner:
name: "[Runner] stop ec2 instance"
if: ${{ always() }}
needs: [start-runner, bundle-linux-hosted]
uses: ledgerhq/actions/.github/workflows/stop-linux-runner.yml@main
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 }}
bundle-linux-hosted:
name: "[Linux] Build"
needs: [start-runner]
runs-on: ${{ needs.start-runner.outputs.label }}
steps:
- name: prepare runner
run: |
sudo growpart /dev/nvme0n1 1
sudo resize2fs /dev/nvme0n1p1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- uses: actions/setup-node@main
if: always()
with:
node-version: 14.x
- name: install yarn
if: always()
run: npm install --global yarn
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- name: kill dpkg
run: sudo killall -w dpkg || echo OK
- name: install and switch to GCC 5.4
run: ./tools/g++-5.4/install.sh
- uses: ledgerhq/actions/packages/has-hash-commit-deps@main
id: has-hash-commit-deps
with:
workspace: ${{ github.workspace }}
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'true' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000 --network-concurrency 1
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'false' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/packages/get-package-infos@main
id: version
with:
path: ${{ github.workspace }}
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: make local version pr
if: github.event_name == 'pull_request'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.event.pull_request.head.sha }}
run: yarn version --new-version="$VERSION"
- name: make local version push
if: github.event_name == 'push'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.sha }}
run: yarn version --new-version="$VERSION"
- name: build the app
run: yarn build-ci
- uses: ledgerhq/actions/packages/get-package-infos@main
id: post-version
with:
path: ${{ github.workspace }}
- name: upload linux app
uses: actions/upload-artifact@v1
with:
name: ${{ steps.post-version.outputs.version }}-linux-x86_64.AppImage
path: dist/${{ steps.post-version.outputs.name }}-${{ steps.post-version.outputs.version }}-linux-x86_64.AppImage
bundle-linux-guest:
name: "[Linux] Build"
needs: [check-if-fork]
runs-on: ubuntu-20.04
if: ${{needs.check-if-fork.outputs.forked || github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- uses: actions/setup-node@main
if: always()
with:
node-version: 14.x
cache: yarn
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- name: install linux dependencies
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: install and switch to GCC 5.4
run: ./tools/g++-5.4/install.sh
- uses: ledgerhq/actions/packages/has-hash-commit-deps@main
id: has-hash-commit-deps
with:
workspace: ${{ github.workspace }}
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'true' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000 --network-concurrency 1
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'false' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/packages/get-package-infos@main
id: version
with:
path: ${{ github.workspace }}
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: make local version pr
if: github.event_name == 'pull_request'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.event.pull_request.head.sha }}
run: yarn version --new-version="$VERSION"
- name: make local version push
if: github.event_name == 'push'
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.sha }}
run: yarn version --new-version="$VERSION"
- name: build the app
run: yarn build-ci
- uses: ledgerhq/actions/packages/get-package-infos@main
id: post-version
with:
path: ${{ github.workspace }}
- name: upload linux app
uses: actions/upload-artifact@v1
with:
name: ${{ steps.post-version.outputs.version }}-linux-x86_64.AppImage
path: dist/${{ steps.post-version.outputs.name }}-${{ steps.post-version.outputs.version }}-linux-x86_64.AppImage
bundle-windows:
name: "[Windows] Build"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- uses: actions/setup-node@main
with:
node-version: 14.x
- uses: actions/setup-python@v2
with:
python-version: 2.x
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- uses: ledgerhq/actions/packages/has-hash-commit-deps@main
id: has-hash-commit-deps
with:
workspace: ${{ github.workspace }}
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'true' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000 --network-concurrency 1
- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'false' }}
env:
JOBS: max
run: yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/packages/get-package-infos@main
id: version
with:
path: ${{ github.workspace }}
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: make local version pr
id: postversion1
if: github.event_name == 'pull_request'
run: echo "::set-output name=content::${{ steps.version.outputs.clean }}-sha.${{ github.event.pull_request.head.sha }}"
- name: make local version push
id: postversion2
if: github.event_name == 'push'
run: echo "::set-output name=content::${{ steps.version.outputs.clean }}-sha.${{ github.sha }}"
- name: build the app
run: yarn build-ci
- name: upload windows
uses: actions/upload-artifact@v1
with:
name: ${{ steps.postversion1.outputs.content }}${{ steps.postversion2.outputs.content }}-win-x64.exe
path: dist/${{ steps.version.outputs.name }}-${{ steps.version.outputs.version }}-win-x64.exe