-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (80 loc) · 3.14 KB
/
firebase_distribution_builder.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
name: Genti Firebase App Distribution Builder
on:
push:
branches: [ production, develop ]
defaults:
run:
shell: bash
working-directory: .
jobs:
build:
name: Firebase App Distribution Builder
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Create Local Properties
run: touch local.properties
- name: Access Local Properties
env:
base_url: ${{ secrets.BASE_URL }}
test_base_url: ${{ secrets.TEST_BASE_URL }}
native_app_key: ${{ secrets.NATIVE_APP_KEY }}
amplitude_api_key: ${{ secrets.AMPLITUDE_API_KEY }}
amplitude_test_key: ${{ secrets.AMPLITUDE_TEST_KEY }}
run: |
echo "base.url=\"$base_url\"" >> local.properties
echo "test.base.url=\"$test_base_url\"" >> local.properties
echo "native.app.key=\"$native_app_key\"" >> local.properties
echo "nativeAppKey=\"$native_app_key\"" >> local.properties
echo "amplitude.api.key=\"$amplitude_api_key\"" >> local.properties
echo "amplitude.test.key=\"$amplitude_test_key\"" >> local.properties
- name: Set up keystore
run: |
echo "$keystore_file" | base64 -d > app/gentiKeystore.jks
- name: Access Keystore Properties
env:
keystore_file: ${{ secrets.KEYSTORE_FILE }}
store_password: ${{ secrets.STORE_PASSWORD }}
key_password: ${{ secrets.KEY_PASSWORD }}
key_alias: ${{ secrets.KEY_ALIAS }}
run: |
echo "storeFile=gentiKeystore.jks" > keystore.properties
echo "storePassword=\"$store_password\"" >> keystore.properties
echo "keyAlias=\"$key_alias\"" >> keystore.properties
echo "keyPassword=\"$key_password\"" >> keystore.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
- name: Build release APK
run: ./gradlew assembleRelease --stacktrace
- name: Upload to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_APP_DISTRIBUTION_KEY }}
groups: tester
file: app/build/outputs/apk/release/app-release.apk
- name: Sync Production to Develop
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin
git checkout develop
git merge production --no-ff --no-edit
git push origin develop