1
+ name : Android Build # # name of the workflow
2
+
3
+ on :
4
+ workflow_dispatch : # To trigger manual build
5
+ release :
6
+ types : [published] # only run the workflow when a new release has been published
7
+
8
+ jobs :
9
+ android-build :
10
+ name : Android Build
11
+ runs-on : ubuntu-latest # using ubuntu latest version / or you can use a specific version
12
+
13
+ steps :
14
+ - name : Check out Git repository # clone the repo to local ci workspace
15
+ uses : actions/checkout@v2
16
+
17
+ - name : Set up our JDK environment # setup JDK environment: mandatory as we need to build android project
18
+ uses : actions/setup-java@v1.4.3
19
+ with :
20
+ java-version : 1.8
21
+
22
+ - name : Get yarn cache directory path
23
+ id : yarn-cache-dir-path
24
+ run : echo "::set-output name=dir::$(yarn cache dir)"
25
+ - name : Restore node_modules from cache
26
+ uses : actions/cache@v2
27
+ id : yarn-cache
28
+ with :
29
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
30
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-yarn-
33
+
34
+ - name : Install dependencies # install project deps with --frozen-lockfile to make sure we will have the same packages version ( very recommended on running yarn install on ci)
35
+ run : yarn install --frozen-lockfile
36
+
37
+ # # configure cash for gradle : will help to reduce build time
38
+ - name : Cache Gradle Wrapper
39
+ uses : actions/cache@v2
40
+ with :
41
+ path : ~/.gradle/wrapper
42
+ key : ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
43
+
44
+ - name : Cache Gradle Dependencies
45
+ uses : actions/cache@v2
46
+ with :
47
+ path : ~/.gradle/caches
48
+ key : ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
49
+ restore-keys : |
50
+ ${{ runner.os }}-gradle-caches-
51
+ - name : Make Gradlew Executable
52
+ run : cd android && chmod +x ./gradlew
53
+
54
+ - name : Generate App APK
55
+ run : |
56
+ cd android && ./gradlew assembleRelease --no-daemon
57
+
58
+ # # sign generated apk
59
+ - name : Sign APK
60
+ id : sign_app
61
+ uses : r0adkll/sign-android-release@v1
62
+ with :
63
+ releaseDirectory : android/app/build/outputs/apk/release
64
+ signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
65
+ alias : ${{ secrets.ANDROID_ALIAS }}
66
+ keyStorePassword : ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
67
+ keyPassword : ${{ secrets.ANDROID_KEY_PASSWORD }}
68
+
69
+ # # Distribute app to Firebase App Distribution for testing / use google play internal track if you have a google play account
70
+ - name : upload artifact to Firebase App Distribution
71
+ uses : wzieba/Firebase-Distribution-Github-Action@v1
72
+ with :
73
+ appId : ${{secrets.ANDROID_FIREBASE_APP_ID}}
74
+ token : ${{secrets.ANDROID_FIREBASE_TOKEN}}
75
+ groups : testers
76
+ file : ${{steps.sign_app.outputs.signedReleaseFile}}
0 commit comments