-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 3.08 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
name: Android CI
on:
push:
branches: [ "github-action" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create local.properties
run: |
echo "DEV_BASE_URL=\"DEV_BASE_URL\"" > local.properties
echo "PROD_BASE_URL=\"PROD_BASE_URL\"" >> local.properties
echo "key_alias=$key_alias" >> local.properties
echo "key_password=$key_password" >> local.properties
echo "store_password=$store_password" >> local.properties
shell: bash
env:
DEV_BASE_URL: ${{ secrets.DEV_BASE_URL }}
PROD_BASE_URL: ${{ secrets.PROD_BASE_URL }}
key_alias: ${{ secrets.ALIAS }}
key_password: ${{ secrets.KEY_PASSWORD }}
store_password: ${{ secrets.KEY_STORE_PASSWORD }}
- name: Decode keystore and create jks
run: echo "${{ secrets.SIGNING_KEY }}" | base64 --decode > nextroom_key
- name: Load Google Service file
run: echo $DATA | base64 -di > app/google-services.json
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Build clean
run: ./gradlew clean
# - name: Run ktlint
# run: ./gradlew ktlintCheck
#
# - name: Run detekt
# run: ./gradlew detekt
- name: Build assemble debug apk
run: ./gradlew assembleDebug --stacktrace
- name: Build assemble release apk
run: ./gradlew assembleRelease --stacktrace
- name: Upload Debug APK
uses: actions/upload-artifact@v3
with:
name: debug
path: ./app/build/outputs/apk/debug/app-debug.apk
- name: Upload Release APK
uses: actions/upload-artifact@v3
with:
name: release
path: ./app/build/outputs/bundle/release/app-release.aab
- name: Upload apk to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: testers
file: app/build/outputs/apk/debug/app-debug.apk
- name: Publish to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.nextroom.nextroom
releaseFiles: ${{ github.workspace }}/app-release.aab
track: production