Repository navigation
64 lines (64 loc) · 2.83 KB
/
Copy pathandroid.yml
File metadata and controls
64 lines (64 loc) · 2.83 KB
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
name: Android App
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: APK build and lint
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: .node-version
- uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
with:
distribution: temurin
java-version: "17"
- uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
with:
packages: platform-tools platforms;android-36 build-tools;36.0.0
- run: npm install --ignore-scripts --no-audit --no-fund
- run: npm --prefix apps/android/ui ci --legacy-peer-deps --no-audit --no-fund
- run: npm run build
- name: Build and lint aBridge Android
run: apps/android/gradlew -p apps/android --no-daemon assembleDebug assembleRelease lintDebug testDebugUnitTest
- name: Build and lint AI Home Android
run: apps/controller/gradlew -p apps/controller --no-daemon assembleDebug assembleRelease lintDebug testDebugUnitTest
- name: "Verify signed APK sizes (aBridge: 300,000 B; AI Home: 2,000,000 B)"
run: |
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
python3 -m venv "$work/python"
"$work/python/bin/python" -m pip install -r tools/android-apk-requirements.txt
keytool -genkeypair -keystore "$work/check.keystore" -alias android -storepass sizecheck -keypass sizecheck \
-keyalg RSA -keysize 2048 -validity 1 -dname "CN=Android size check"
export ANDROID_KEYSTORE_BASE64="$(openssl base64 -A -in "$work/check.keystore")"
export ANDROID_KEYSTORE_PASSWORD=sizecheck ANDROID_KEY_ALIAS=android ANDROID_KEY_PASSWORD=sizecheck
export ANDROID_APK_PYTHON="$work/python/bin/python"
bash tools/sign-android-release.sh abridge
bash tools/sign-android-release.sh aihome
- name: Upload installable Debug APK
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: abridge-android-debug
path: apps/android/build/outputs/apk/debug/*.apk
if-no-files-found: error
retention-days: 14
- name: Upload installable AI Home Debug APK
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: aihome-android-debug
path: apps/controller/build/outputs/apk/debug/*.apk
if-no-files-found: error
retention-days: 14