-
Notifications
You must be signed in to change notification settings - Fork 16
104 lines (99 loc) · 3.05 KB
/
android.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Android CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Add support for manual trigger(if needed)
workflow_dispatch:
inputs:
app_id:
description: 'The application Id of the current build'
required: true
branch:
description: 'The branch from which we have to build'
required: true
default: 'master'
jobs:
build:
name: Setup Environment and build
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@v1
- name: Checkout the code to specific branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
# Setup JDK
- name: Set up JDK
uses: actions/setup-java@v1
# uses: actions/setup-java@v2
with:
# distribution: 'zulu'
java-version: 17
# Setup Android SDK
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Change wrapper permissions
run: chmod +x ./gradlew
# Run Build Project
- name: Build gradle project
run: ./gradlew build
# Gradle Caching(optional)
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Make Gradle Executable
- name: Make gradlew executable
run: chmod +x ./gradlew
# For Bundle:
- name: Generate app bundle
run: ./gradlew app:bundleRelease --stacktrace
# For APK:
- name: Generate app APK.
run: ./gradlew assembleRelease --stacktrace
## Sign the Artifact
# - name: Sign app bundle
# run: |
# jarsigner -keystore app/*.jks \
# -storepass ${{ secrets.KEY_STORE_PASSWORD }} -keypass ${{ secrets.KEY_PASSWORD }} \
# app/build/outputs/bundle/release/app-release.aab ${{ secrets.ALIAS }}
#
# # STEP 2 : Upload the Artifact
# upload:
# needs: [ build ]
# name: Upload the signed artifact
# runs-on: self-hosted
# steps:
# - name: Upload Bundle
# uses: actions/upload-artifact@v2
# with:
# name: signed_app_bundle
# path: app/build/outputs/bundle/release/app-release.aab
#
#
# # Step 3 : Release to playstore
# deploy:
# needs: [ build ]
# name: Create release on Playstore
# runs-on: self-hosted
# steps:
# - name: Create service_account.json
# run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
#
# - name: Deploy to Play Store
# uses: r0adkll/upload-google-play@v1.0.15
# with:
# serviceAccountJson: service_account.json
# packageName: ${{ github.event.inputs.app_id }}
# releaseFiles: app/build/outputs/bundle/release/*.aab
# track: internal
# whatsNewDirectory: whatsnew/
# mappingFile: app/build/outputs/mapping/release/mapping.txt
# inAppUpdatePriority: 5