Skip to content

Commit a75dfea

Browse files
committed
Optimized Workflow File
1 parent da72870 commit a75dfea

1 file changed

Lines changed: 56 additions & 37 deletions

File tree

.github/workflows/android-build.yml

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,62 @@ on:
66
- '**'
77

88
jobs:
9-
build:
9+
build-android:
1010
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'temurin'
18+
java-version: '22'
19+
20+
- name: Cache Android Gradle
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.gradle/caches
25+
~/.gradle/wrapper
26+
Android/.gradle
27+
key: ${{ runner.os }}-android-gradle-${{ hashFiles('Android/gradlew', 'Android/build.gradle', 'Android/app/build.gradle') }}
28+
29+
- name: Build APK
30+
run: chmod +x gradlew && ./gradlew assembleDebug
31+
working-directory: ./Android
32+
33+
- name: Upload APK artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: debug-apk
37+
path: Android/app/build/outputs/apk/debug/app-debug.apk
1138

39+
build-videoserver:
40+
runs-on: ubuntu-latest
1241
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Make gradlew executable (Android)
17-
run: chmod +x gradlew
18-
working-directory: ./Android
19-
20-
- name: Build APK
21-
run: ./gradlew assembleDebug
22-
working-directory: ./Android
23-
24-
- name: Upload APK artifact
25-
uses: actions/upload-artifact@v4
26-
with:
27-
name: debug-apk
28-
path: Android/app/build/outputs/apk/debug/app-debug.apk
29-
30-
- name: Set up JDK
31-
uses: actions/setup-java@v4
32-
with:
33-
distribution: 'temurin'
34-
java-version: '22'
35-
36-
- name: Make gradlew executable (VideoServer)
37-
run: chmod +x gradlew
38-
working-directory: ./VideoServer
39-
40-
- name: Build VideoServer
41-
run: ./gradlew build
42-
working-directory: ./VideoServer
43-
44-
- name: Upload VideoServer jar artifact
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: video-server-jar
48-
path: VideoServer/build/libs/*.jar
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up JDK
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: 'temurin'
48+
java-version: '22'
49+
50+
- name: Cache VideoServer Gradle
51+
uses: actions/cache@v3
52+
with:
53+
path: |
54+
~/.gradle/caches
55+
~/.gradle/wrapper
56+
VideoServer/.gradle
57+
key: ${{ runner.os }}-videoserver-gradle-${{ hashFiles('VideoServer/gradlew', 'VideoServer/build.gradle') }}
58+
59+
- name: Build VideoServer
60+
run: chmod +x gradlew && ./gradlew build
61+
working-directory: ./VideoServer
62+
63+
- name: Upload VideoServer jar artifact
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: video-server-jar
67+
path: VideoServer/build/libs/*.jar

0 commit comments

Comments
 (0)