-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (55 loc) · 2.41 KB
/
build-debug.yaml
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
name: debug build Android
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: 'Linux info'
run: lsb_release -a
- name: 'Updating ubuntu deps'
run: sudo apt update --fix-missing && sudo apt upgrade -y
- name: 'Installing deps'
run: sudo apt install -y android-tools-adb android-tools-fastboot default-jre default-jdk android-sdk
- name: 'Exporting android sdk'
run: export ANDROID_SDK_ROOT=/usr/lib/android-sdk
- name: 'Download and extract android-cli tools'
run: curl https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip --output commandlinetools-linux-9123335_latest.zip && sudo mkdir /usr/lib/android-sdk/cmdline-tools && sudo unzip -o commandlinetools-linux-9123335_latest.zip -d /usr/lib/android-sdk/cmdline-tools
- name: 'Listing commandlinetools.zip'
run: unzip -l commandlinetools-linux-9123335_latest.zip
- name: 'Reload bash'
run: . ~/.bashrc
- name: 'echo'
run: echo $ANDROID_SDK_ROOT && echo '-------' && echo $PATH | tr ':' '\n'
- name: 'Clearing the clutter'
run: rm commandlinetools-linux-9123335_latest.zip
- name: 'adb version'
run: adb version
- name: 'unzip version'
continue-on-error: true
run: unzip --version
- name: 'java version'
run: java -version
- name: 'java-compiler version'
run: javac -version
- name: 'sdkmanager version'
run: /usr/lib/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager --version
- name: 'install buildtool 30.0.3 and accept license'
run: yes | sudo /usr/lib/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager "build-tools;30.0.3" "platform-tools"
- name: 'accept all licenses'
run: yes | /usr/lib/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses
- name: 'transfer ownership (as tools are installed under root, they need to excuted under root) ,'
run: sudo chown -R $(whoami) $ANDROID_SDK_ROOT
- name: 'Build android project'
run: ./gradlew assembleDebug
- name: 'list build directory'
run: ls app/build/outputs/apk/debug/
- name: 'store .apk'
uses: actions/upload-artifact@v3
with:
name: apk-debug
path: app/build/outputs/apk/debug/app-debug.apk