-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
103 lines (89 loc) · 3.14 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
name: 'KMP Publish Android App to Play Store Beta'
description: 'Publish the Android app to the Play Store Beta or Internal Track'
author: 'Mifos Initiative'
branding:
icon: 'upload'
color: 'orange'
inputs:
release_type:
description: 'Type of release'
required: true
android_package_name:
description: 'Name of the Android project module'
required: true
keystore_file:
description: 'Base64 encoded keystore file'
required: true
keystore_password:
description: 'Password for the keystore file'
required: true
keystore_alias:
description: 'Key alias for the keystore file'
required: true
keystore_alias_password:
description: 'Password for the key alias'
required: true
google_services:
description: 'Google services JSON file'
required: true
playstore_creds:
description: 'Firebase credentials JSON file'
required: true
runs:
using: composite
steps:
# Setup Ruby for Fastlane
- name: Configure Ruby
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
bundler-cache: true
# Install Fastlane and plugins for Play Store deployment
- 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:
KEYSTORE: ${{ inputs.keystore_file }}
GOOGLE_SERVICES: ${{ inputs.google_services }}
PLAYSTORE_CREDS: ${{ inputs.playstore_creds }}
run: |
mkdir -p secrets
# Inflate keystore
echo $KEYSTORE | base64 --decode > keystores/release_keystore.keystore
# Inflate google-services.json
echo $GOOGLE_SERVICES | base64 --decode > ${{ inputs.android_package_name }}/google-services.json
# Inflate PlayStore credentials
touch secrets/playStorePublishServiceCredentialsFile.json
echo $PLAYSTORE_CREDS | base64 --decode > secrets/playStorePublishServiceCredentialsFile.json
- name: Bundle Android App
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 bundlePlayStoreRelease \
storeFile:release_keystore.keystore \
storePassword:${{ env.KEYSTORE_PASSWORD }} \
keyAlias:${{ env.KEYSTORE_ALIAS }} \
keyPassword:${{ env.KEYSTORE_ALIAS_PASSWORD }}
# Save AAB files as artifacts
- name: Archive Build
uses: actions/upload-artifact@v4
with:
name: release-aabs
path: ./**/*.aab
# Deploy to Play Store Internal testing track
- name: Deploy to Playstore Internal
shell: bash
run: bundle exec fastlane android deploy_internal
# Promote to beta if specified
- name: Promote Internal to Beta
shell: bash
if: inputs.release_type == 'beta'
run: bundle exec fastlane android promote_to_beta