forked from Cairo-Squad/EvolveFit
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.63 KB
/
Copy pathcd-firebase.yml
File metadata and controls
83 lines (72 loc) · 2.63 KB
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
name: EvolveFit CD Pipeline
on:
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
run: |
mkdir -p composeApp/
echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json
echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json
shell: bash
- name: Decode Keystore and Create local.properties
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
rm -f composeApp/JKS.jks local.properties release_notes.txt
echo "$KEYSTORE" | base64 -d > composeApp/JKS.jks
echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties
echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties
echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties
- name: Generate Signed APK
run: |
./gradlew assembleRelease --build-cache -x test -x lint
- name: Find APKs
run: |
echo "Searching for APKs..."
find . -type f -name "*.apk"
- name: Create Release Notes
run: |
echo "Automated build from GitHub Actions on $(date)" > release_notes.txt
- name: Upload APKs to Firebase App Distribution
env:
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_AUTH_TOKEN: ${{ secrets.FIREBASE_AUTH_TOKEN }}
run: |
npm install -g firebase-tools
firebase appdistribution:distribute \
composeApp/build/outputs/apk/release/composeApp-release.apk \
--app "$FIREBASE_APP_ID" \
--token "$FIREBASE_AUTH_TOKEN" \
--groups "cairo_squad" \
--release-notes-file release_notes.txt