forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (96 loc) · 3.17 KB
/
android.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
name: Android
on:
push:
tags:
- v*
branches:
- master
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '.github/workflows/android.yml'
pull_request:
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/berty-i18n/locale/*/*.json'
- '.github/workflows/android.yml'
jobs:
build:
name: Build for Android
runs-on: ubuntu-latest
strategy:
matrix:
golang: ['1.16.x']
node: ['14.x']
java: ['1.8']
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }} # see https://github.com/actions/checkout/issues/299
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-v1-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang }}-v1-
- name: Cache Node modules
uses: actions/[email protected]
with:
path: js/node_modules
key: ${{ runner.OS }}-node-${{ matrix.node }}-v2-${{ hashFiles('js/yarn.lock') }}
restore-keys: ${{ runner.OS }}-node-${{ matrix.node }}-v2-
- name: Cache Gomobile .aar
uses: actions/[email protected]
with:
path: js/android/libs/gobridge.aar
key: android-gomobile-${{ matrix.golang }}-v1-${{ hashFiles('go/**/*.go', 'go.sum') }}
restore-keys: android-gomobile-${{ matrix.golang }}-v1-
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build .env
run: cat tool/build/shakebugs-infos/env.prod >> js/.env
- name: Build the APK
working-directory: js
env:
CI: "true"
run: |
make android.app_deps
(yarn jetify && cd android && ./gradlew -i app:bundleReleaseYolo)
### TODO: move this part on Yolo and use release keystore ###
mkdir -p $HOME/.android
cp android/app/debug.keystore $HOME/.android
wget \
https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar \
-O /tmp/bundletool.jar
java -jar /tmp/bundletool.jar build-apks \
--bundle=android/app/build/outputs/bundle/releaseYolo/app-releaseYolo.aab \
--output=${{ github.workspace }}/app.apks \
--mode=universal
cd ${{ github.workspace }} && unzip app.apks
################################################
- name: Upload the APK
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/universal.apk
name: berty-universal-${{github.sha}}.apk
if-no-files-found: error