-
Notifications
You must be signed in to change notification settings - Fork 26
63 lines (55 loc) · 1.68 KB
/
android-build.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
name: myPlanet build test
on:
push:
branches:
- '*'
- '!master'
jobs:
build:
name: myPlanet build test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build: [default, lite]
env:
FILES: |
app/src/main/AndroidManifest.xml
app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt
app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt
app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt
steps:
- name: checkout repository code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: check for .lite diffs
if: matrix.build == 'lite'
run: |
echo "${{ env.FILES }}" | xargs -n 1 | while read file; do
ls -al $file*
diff "$file" "$file.lite" || true
done
- name: setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: setup gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.7
cache-disabled: false
cache-read-only: false
cache-write-only: false
- name: diff the code to get lite
if: matrix.build == 'lite'
run: |
echo "${{ env.FILES }}" | xargs -n 1 | while read file; do
ls -al $file*
cp "${file}.lite" "$file"
done
ls -al app/build.gradle
sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle
- name: build debug as test
run: ./gradlew assembleDebug --configuration-cache --no-daemon