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 115
182 lines (176 loc) · 6.38 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
name: "[Build] Android Apk"
on:
pull_request:
branches:
- "*"
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 }})"
start-runner:
needs: [check-if-fork]
if: ${{ !needs.check-if-fork.outputs.forked && github.actor != 'dependabot[bot]' }}
name: "start ec2 instance (Linux)"
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: "stop ec2 instance (Linux)"
needs: [start-runner, bundle-apk-hosted]
uses: ledgerhq/actions/.github/workflows/stop-linux-runner.yml@main
if: ${{ always() && !needs.check-if-fork.outputs.forked && github.actor != 'dependabot[bot]' }}
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-apk-hosted:
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.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: set git user
run: |
git config user.email "[email protected]"
git config user.name "Team Live"
- uses: actions/setup-node@main
if: always()
with:
node-version: 14.x
- name: install yarn
if: always()
run: npm i -g yarn
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
env:
ImageOS: ubuntu20
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Android SDK
uses: android-actions/[email protected]
- 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/[email protected]
id: version
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(git rev-parse HEAD)"
- name: make local version
run: yarn version --new-version=${{ steps.version.outputs.clean }}-sha.${{ steps.slug.outputs.sha8 }}
- name: build the app
env:
ANDROID_KEYSTORE_PASS: staging
ANDROID_KEY_ALIAS: staging
ANDROID_KEY_PASS: staging
NODE_OPTIONS: "--max-old-space-size=7168"
run: ANDROID_KEYSTORE_FILE="$(pwd)/android/app/staging.kstr" yarn android:local:apk
- uses: ledgerhq/actions/[email protected]
id: post-version
- name: upload Android app
uses: actions/upload-artifact@v1
with:
name: ${{ steps.post-version.outputs.version }}-release
path: android/app/build/outputs/apk/release
bundle-apk-guest:
needs: [check-if-fork]
if: ${{ needs.check-if-fork.outputs.forked || github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: set git user
run: |
git config user.email "[email protected]"
git config user.name "Team Live"
- uses: actions/setup-node@main
with:
node-version: 14.x
cache: yarn
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- 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/[email protected]
id: version
- name: set beta name
uses: ledgerhq/actions/packages/change-product-name@main
with:
path: ${{ github.workspace }}
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(git rev-parse HEAD)"
- name: make local version
run: yarn version --new-version=${{ steps.version.outputs.clean }}-sha.${{ steps.slug.outputs.sha8 }}
- name: build the app
env:
ANDROID_KEYSTORE_PASS: staging
ANDROID_KEY_ALIAS: staging
ANDROID_KEY_PASS: staging
NODE_OPTIONS: "--max-old-space-size=7168"
run: ANDROID_KEYSTORE_FILE="$(pwd)/android/app/staging.kstr" yarn android:local:apk
- uses: ledgerhq/actions/[email protected]
id: post-version
- name: upload Android app
uses: actions/upload-artifact@v1
with:
name: ${{ steps.post-version.outputs.version }}-release
path: android/app/build/outputs/apk/release