Skip to content

Commit d4b1433

Browse files
committed
Update secrets for android
1 parent 5ec0d18 commit d4b1433

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

.github/actions/build-android/action.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
keystoreKeyPassword:
2121
description: 'Key password for the Android keystore'
2222
required: true
23+
playStoreCredentialsBase64:
24+
description: 'Base64-encoded Play Store credentials JSON file'
25+
required: true
2326

2427
runs:
2528
using: composite
@@ -53,10 +56,26 @@ runs:
5356
echo $GOOGLE_SERVICES_JSON | base64 --decode > android/app/google-services.json
5457
shell: bash
5558

59+
- name: Decode upload.keystore
60+
env:
61+
KEYSTORE_BASE64: ${{ inputs.keystoreBase64 }}
62+
run: |
63+
mkdir -p android/keystores
64+
echo $KEYSTORE_BASE64 | base64 --decode > android/keystores/upload.keystore
65+
shell: bash
66+
67+
- name: Decode Play Store credentials
68+
env:
69+
PLAY_STORE_CREDENTIALS_BASE64: ${{ inputs.playStoreCredentialsBase64 }}
70+
run: |
71+
mkdir -p android/fastlane
72+
echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > android/fastlane/play-store-credentials.json
73+
shell: bash
74+
5675
- name: Build Android Library with Fastlane
5776
run: |
5877
cd android
59-
fastlane android local
78+
fastlane android internal submit:false
6079
shell: bash
6180
env:
6281
FIREBASE_API_KEY: ${{ inputs.firebaseAPIKey }}

.github/workflows/MiNe2e.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,21 @@ jobs:
106106
UPLOAD_KEYSTORE_BASE64: ${{ secrets.UPLOAD_KEYSTORE_BASE64 }}
107107
PLAY_STORE_CREDENTIALS_BASE64: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}
108108
run: |
109+
mkdir -p ./android/keystores
109110
echo $UPLOAD_KEYSTORE_BASE64 | base64 --decode > ./android/keystores/upload.keystore
110111
echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > ./android/fastlane/play-store-credentials.json
111112
shell: bash
112113

113114
- name: Build Android apk
114-
uses: ./.github/actions/build_android
115+
uses: ./.github/actions/build-android
115116
with:
117+
google_services_json: ${{ secrets.GOOGLE_SERVICES_JSON }}
116118
firebaseAPIKey: ${{ secrets.FIREBASE_API_KEY }}
117-
keystorePath: ${{ env.ANDROID_KEYSTORE_PATH }}
119+
keystoreBase64: ${{ secrets.UPLOAD_KEYSTORE_BASE64 }}
118120
keystoreAlias: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
119121
keystorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
120122
keystoreKeyPassword: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
123+
playStoreCredentialsBase64: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}
121124

122125
ios-app:
123126
runs-on: macOS-15

android/fastlane/Fastfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,22 @@ platform :android do
4343
UI.message("Building DeveloperApp")
4444
gradle(task: "assemble", build_type: "Debug", flavor: "Production", flags: "--stacktrace", properties: gradleOptions)
4545

46-
# UI.message("Installing APK into Android device/simulator")
47-
# lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].each do |apk|
48-
# begin
49-
# sh("adb reverse tcp:8080 tcp:8080")
50-
# sh("adb reverse tcp:8083 tcp:8083")
51-
# sh("adb install -r #{apk}")
52-
# end
53-
# end
46+
UI.message("Installing APK into Android device/simulator")
47+
lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].each do |apk|
48+
begin
49+
sh("adb reverse tcp:8080 tcp:8080")
50+
sh("adb reverse tcp:8083 tcp:8083")
51+
sh("adb install -r #{apk}")
52+
end
53+
end
5454
end
5555

5656
desc "Build new bundle and upload to Internal track"
5757
lane :internal do |options|
5858
FileUtils.copy(ORIGINAL_CHANGELOG_PATH, FASTLANE_CHANGELOG_PATH)
5959
versionCode = google_play_track_version_codes(track: "internal").max() + 1
60-
versionName = GOOGLE_PLAY_VERSION + "." + BUILD_NUMBER
60+
# versionName = GOOGLE_PLAY_VERSION + "." + BUILD_NUMBER
61+
versionName = BUILD_NUMBER
6162

6263
gradleOptions = {
6364
# Gradle 7.3 removed support for dynamic versioning through android.injected.version.code
@@ -93,6 +94,7 @@ platform :android do
9394
track: "internal",
9495
skip_upload_images: true,
9596
skip_upload_apk: true,
97+
json_key: "./fastlane/play-store-credentials.json",
9698
)
9799
else
98100
UI.message "Building APK version #{versionName}(#{versionCode}) for internal tests"

0 commit comments

Comments
 (0)