-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
123 lines (109 loc) · 3.99 KB
/
action.yaml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: KMP Android App Publish On Firebase
description: 'Build and deploy Android app on Firebase App Distribution using fastlane'
author: 'Mifos Initiative'
branding:
icon: upload-cloud
color: blue
inputs:
android_package_name:
description: 'Name of the Android project module'
required: true
release_type:
description: 'Type of release to be deployed eg. demo, prod'
required: false
default: 'prod'
keystore_file:
description: 'Base64 encoded keystore file'
required: false
keystore_password:
description: 'Password for the keystore file'
required: false
keystore_alias:
description: 'Alias for the keystore file'
required: false
keystore_alias_password:
description: 'Password for the keystore alias'
required: false
google_services:
description: 'Google services JSON file'
required: true
firebase_creds:
description: 'Firebase credentials JSON file'
required: true
tester_groups:
description: 'Firebase Tester Group'
required: true
runs:
using: composite
steps:
# Setup Ruby for Fastlane automation
- name: Configure Ruby
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
bundler-cache: true
# Install Fastlane and required plugins for deployment automation
- name: Install Fastlane
shell: bash
run: |
gem install bundler:2.2.27
bundle install --jobs 4 --retry 3
bundle exec fastlane add_plugin firebase_app_distribution
bundle exec fastlane add_plugin increment_build_number
- name: Inflate Secrets
shell: bash
env:
GOOGLE_SERVICES: ${{ inputs.google_services }}
FIREBASE_CREDS: ${{ inputs.firebase_creds }}
KEYSTORE: ${{ inputs.keystore_file }}
run: |
mkdir -p secrets
# Inflate google-services.json
echo $GOOGLE_SERVICES | base64 --decode > ${{ inputs.android_package_name }}/google-services.json
# Inflate keystore
echo $KEYSTORE | base64 --decode > keystores/release_keystore.keystore
# Inflate Firebase credentials
touch secrets/firebaseAppDistributionServiceCredentialsFile.json
echo $FIREBASE_CREDS | base64 --decode > secrets/firebaseAppDistributionServiceCredentialsFile.json
# Deploy to Firebase App Distribution
- name: ☁️ Deploy Prod Application on Firebase
if: ${{ inputs.release_type == 'prod' }}
shell: bash
env:
KEYSTORE_PASSWORD: ${{ inputs.keystore_password }}
KEYSTORE_ALIAS: ${{ inputs.keystore_alias }}
KEYSTORE_ALIAS_PASSWORD: ${{ inputs.keystore_alias_password }}
run: |
bundle exec fastlane android deployReleaseApkOnFirebase \
storeFile:release_keystore.keystore \
storePassword:${{ env.KEYSTORE_PASSWORD }} \
keyAlias:${{ env.KEYSTORE_ALIAS }} \
keyPassword:${{ env.KEYSTORE_ALIAS_PASSWORD }} \
groups:${{ inputs.tester_groups }}
# Deploy to Firebase App Distribution
- name: ☁️ Deploy Demo Application on Firebase
if: ${{ inputs.release_type == 'demo' }}
shell: bash
env:
KEYSTORE_PASSWORD: ${{ inputs.keystore_password }}
KEYSTORE_ALIAS: ${{ inputs.keystore_alias }}
KEYSTORE_ALIAS_PASSWORD: ${{ inputs.keystore_alias_password }}
run: |
bundle exec fastlane android deployDemoApkOnFirebase \
storeFile:release_keystore.keystore \
storePassword:${{ env.KEYSTORE_PASSWORD }} \
keyAlias:${{ env.KEYSTORE_ALIAS }} \
keyPassword:${{ env.KEYSTORE_ALIAS_PASSWORD }} \
groups:${{ inputs.tester_groups }}
# Clean up secrets
- name: Clean up secrets
shell: bash
run: |
rm -rf secrets
rm -rf ${{ inputs.android_package_name }}/google-services.json
rm -rf keystores/release_keystore.keystore
- name: Upload APK as artifact
uses: actions/upload-artifact@v4
with:
name: firebase-app
path: |
**/*.apk