-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (70 loc) · 2.58 KB
/
android-ci-cd-dev.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
name: Android CI/CD for release(generating demo APK)
on:
push:
paths: 'android/**'
branches: [ "release-an" ]
env:
BASE_URL: ${{ secrets.BASE_URL }}
DEV_BASE_URL: ${{ secrets.DEV_BASE_URL }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
SECRETS_PROPERTIES: ${{ secrets.SECRETS_PROPERTIES }}
LOCAL_DEFAULTS_PROPERTIES: ${{ secrets.LOCAL_DEFAULTS_PROPERTIES }}
UPLOAD_KEY_STORE_JKS: ${{ secrets.UPLOAD_KEY_STORE_JKS }}
KEY_STORE_PROPERTIES: ${{ secrets.KEY_STORE_PROPERTIES }}
jobs:
apk:
name: Generate APK
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./android/Staccato_AN
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Create local.properties
run: |
touch local.properties
- name: Set Base Url in local.properties
run: |
echo "base_url=\"$BASE_URL\"" >> local.properties
- name: Set Develop Base Url in local.properties
run: |
echo "dev_base_url=\"$DEV_BASE_URL\"" >> local.properties
- name: Create google-services.json
run: |
echo $GOOGLE_SERVICES_JSON > ./app/google-services.json
- name: Create secrets.properties
run: |
echo $SECRETS_PROPERTIES > secrets.properties
- name: Create local.defaults.properties
run: |
echo $LOCAL_DEFAULTS_PROPERTIES > local.defaults.properties
- name: Create KeyStore File and Properties
run: |
mkdir -p ./app/signing
echo "$UPLOAD_KEY_STORE_JKS" | base64 --decode > ./app/signing/upload_key_store.jks
echo "$KEY_STORE_PROPERTIES" > ./app/signing/keystore.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Release APK
run: ./gradlew assembleRelease
- name: Upload Release APK
uses: actions/upload-artifact@v3
with:
name: app-release.apk
path: android/Staccato_AN/app/build/outputs/apk/release/app-release.apk
- name: Upload Artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: staccato_tester
file: android/Staccato_AN/app/build/outputs/apk/release/app-release.apk