Skip to content

Commit fd1e121

Browse files
committed
Update config
1 parent 865564d commit fd1e121

File tree

3 files changed

+121
-99
lines changed

3 files changed

+121
-99
lines changed

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

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,68 @@ runs:
5353
env:
5454
GOOGLE_SERVICES_JSON: ${{ inputs.google_services_json }}
5555
run: |
56-
echo $GOOGLE_SERVICES_JSON | base64 --decode > android/app/google-services.json
56+
echo "$GOOGLE_SERVICES_JSON" | base64 -d > android/app/google-services.json
5757
shell: bash
5858

5959
- name: Decode upload.keystore
6060
env:
61-
KEYSTORE_BASE64: ${{ inputs.keystoreBase64 }}
61+
UPLOAD_KEYSTORE_BASE64: ${{ inputs.keystoreBase64 }}
6262
run: |
6363
mkdir -p android/keystores
64-
echo $KEYSTORE_BASE64 | base64 --decode > android/keystores/upload.keystore
64+
# Add quotes to preserve newlines and use -d flag instead of --decode for better compatibility
65+
echo "$UPLOAD_KEYSTORE_BASE64" | base64 -d > android/keystores/upload.keystore
6566
shell: bash
6667

6768
- name: Decode Play Store credentials
6869
env:
6970
PLAY_STORE_CREDENTIALS_BASE64: ${{ inputs.playStoreCredentialsBase64 }}
7071
run: |
7172
mkdir -p android/fastlane
72-
echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > android/fastlane/play-store-credentials.json
73+
echo "$PLAY_STORE_CREDENTIALS_BASE64" | base64 -d > android/fastlane/play-store-credentials.json
7374
shell: bash
74-
# - name: Verify Keystore File
75-
# run: |
76-
# keytool -list -v -keystore ./android/keystores/upload.keystore -storepass ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
77-
# shell: bash
75+
76+
- name: Verify Keystore File
77+
run: |
78+
echo "Verifying keystore file exists and has content..."
79+
ls -la android/keystores/
80+
if [ ! -s android/keystores/upload.keystore ]; then
81+
echo "Error: Keystore file is empty or doesn't exist!"
82+
exit 1
83+
fi
84+
85+
echo "File type information:"
86+
file android/keystores/upload.keystore
87+
88+
echo "Attempting to verify keystore with different store types..."
89+
# Try JKS format
90+
keytool -list -v -keystore android/keystores/upload.keystore -storepass "${{ inputs.keystorePassword }}" -storetype JKS || true
91+
92+
# Try PKCS12 format
93+
keytool -list -v -keystore android/keystores/upload.keystore -storepass "${{ inputs.keystorePassword }}" -storetype PKCS12 || true
94+
95+
# Try BKS format (if running on newer Java versions)
96+
keytool -list -v -keystore android/keystores/upload.keystore -storepass "${{ inputs.keystorePassword }}" -storetype BKS || true
97+
98+
# # Try JCEKS format
99+
# keytool -list -v -keystore android/keystores/upload.keystore -storepass "${{ inputs.keystorePassword }}" -storetype JCEKS || true
100+
101+
echo "Checking first few bytes of keystore file (hex):"
102+
hexdump -C -n 32 android/keystores/upload.keystore || xxd -l 32 android/keystores/upload.keystore || true
103+
shell: bash
104+
105+
- name: Verify Keystore File
106+
run: |
107+
echo "Verifying keystore file exists and has content..."
108+
ls -la android/keystores/
109+
if [ ! -s android/keystores/upload.keystore ]; then
110+
echo "Error: Keystore file is empty or doesn't exist!"
111+
exit 1
112+
fi
113+
114+
echo "Verifying keystore with keytool..."
115+
keytool -list -v -keystore android/keystores/upload.keystore -storepass "${{ inputs.keystorePassword }}" | head -n 5
116+
shell: bash
117+
78118
- name: Build Android Library with Fastlane
79119
run: |
80120
cd android
@@ -87,6 +127,7 @@ runs:
87127
ANDROID_KEYSTORE_ALIAS: ${{ inputs.keystoreAlias }}
88128
ANDROID_KEYSTORE_KEY_PASSWORD: ${{ inputs.keystoreKeyPassword }}
89129
PLAY_STORE_CREDENTIALS_PATH: ${{ github.workspace }}/android/fastlane/play-store-credentials.json
130+
BUILD_NUMBER: ${{ github.run_number }}
90131

91132
- name: Copy Android APK to Shared Directory
92133
run: |

.github/workflows/MiNe2e.yaml

Lines changed: 52 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,6 @@ jobs:
102102
- name: "Check out code"
103103
uses: actions/checkout@v4
104104

105-
# - name: Retrieve the secrets and decode it to a file
106-
# env:
107-
# UPLOAD_KEYSTORE_BASE64: ${{ secrets.UPLOAD_KEYSTORE_BASE64 }}
108-
# PLAY_STORE_CREDENTIALS_BASE64: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}
109-
# run: |
110-
# mkdir -p ./android/keystores
111-
# echo $UPLOAD_KEYSTORE_BASE64 | base64 --decode > ./android/keystores/upload.keystore
112-
# echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > ./android/fastlane/play-store-credentials.json
113-
# shell: bash
114-
115105
- name: Build Android apk
116106
uses: ./.github/actions/build-android
117107
with:
@@ -122,10 +112,6 @@ jobs:
122112
keystorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
123113
keystoreKeyPassword: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
124114
playStoreCredentialsBase64: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}
125-
# keystorePath: ${{ secrets.UPLOAD_KEYSTORE_BASE64 }}
126-
# playStoreCredentialsPath: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}
127-
# # keystorePath: ${{ github.workspace }}/android/keystores/upload.keystore
128-
# # playStoreCredentialsPath: ${{ github.workspace }}/android/fastlane/play-store-credentials.json
129115

130116
ios-app:
131117
runs-on: macOS-15
@@ -231,24 +217,6 @@ jobs:
231217
bash maestro/helpers/prepare_android.sh
232218
bash maestro/run_maestro_tests.sh android
233219
234-
# - name: "Capture emulator logs"
235-
# if: always()
236-
# continue-on-error: true
237-
# run: |
238-
# mkdir -p ${{ github.workspace }}/emulator-logs
239-
# adb logcat -d > ${{ github.workspace }}/emulator-logs/emulator-logcat.txt
240-
# adb shell dmesg > ${{ github.workspace }}/emulator-logs/emulator-dmesg.txt
241-
# shell: bash
242-
243-
# - name: "Upload emulator logs"
244-
# uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
245-
# continue-on-error: true
246-
# if: always()
247-
# with:
248-
# name: emulator-logs
249-
# path: ${{ github.workspace }}/emulator-logs/
250-
# if-no-files-found: warn
251-
252220
- name: "Debug root folder"
253221
if: always()
254222
continue-on-error: true
@@ -274,65 +242,65 @@ jobs:
274242
if-no-files-found: warn
275243

276244

277-
compare-screenshots:
278-
needs: [android-test]
279-
runs-on: ubuntu-latest
280-
if: always()
281-
env:
282-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
283-
steps:
284-
- name: "Check out code"
285-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
245+
# compare-screenshots:
246+
# needs: [android-test]
247+
# runs-on: ubuntu-latest
248+
# if: always()
249+
# env:
250+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
251+
# steps:
252+
# - name: "Check out code"
253+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
286254

287255

288-
- name: "Download all Android screenshots"
289-
run: |
290-
mkdir -p images/actual/android/
291-
echo "Downloading all Android screenshots..."
292-
gh run download ${{ github.run_id }} --name android-screenshots --dir images/actual/android/ || echo "⚠️ Failed to download Android screenshots."
293-
ls -l images/actual/android/
256+
# - name: "Download all Android screenshots"
257+
# run: |
258+
# mkdir -p images/actual/android/
259+
# echo "Downloading all Android screenshots..."
260+
# gh run download ${{ github.run_id }} --name android-screenshots --dir images/actual/android/ || echo "⚠️ Failed to download Android screenshots."
261+
# ls -l images/actual/android/
294262

295-
- name: "Download all iOS screenshots"
296-
run: |
297-
mkdir -p images/actual/ios/
298-
echo "Downloading all iOS screenshots..."
299-
gh run download ${{ github.run_id }} --name ios-screenshots --dir images/actual/ios/ || echo "⚠️ Failed to download iOS screenshots."
300-
ls -l images/actual/ios/
263+
# - name: "Download all iOS screenshots"
264+
# run: |
265+
# mkdir -p images/actual/ios/
266+
# echo "Downloading all iOS screenshots..."
267+
# gh run download ${{ github.run_id }} --name ios-screenshots --dir images/actual/ios/ || echo "⚠️ Failed to download iOS screenshots."
268+
# ls -l images/actual/ios/
301269

302-
- name: "Set up node"
303-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
304-
with:
305-
node-version-file: .nvmrc
306-
cache: npm
270+
# - name: "Set up node"
271+
# uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
272+
# with:
273+
# node-version-file: .nvmrc
274+
# cache: npm
307275

308-
- name: "Install npm and dependencies"
309-
run: npm install && npm install @actions/core pixelmatch
276+
# - name: "Install npm and dependencies"
277+
# run: npm install && npm install @actions/core pixelmatch
310278

311-
- name: "Compare Android screenshots"
312-
continue-on-error: true
313-
run: node ${{ github.workspace }}/maestro/helpers/compare_screenshots.js android
279+
# - name: "Compare Android screenshots"
280+
# continue-on-error: true
281+
# run: node ${{ github.workspace }}/maestro/helpers/compare_screenshots.js android
314282

315-
- name: "Compare iOS screenshots"
316-
continue-on-error: true
317-
run: node ${{ github.workspace }}/maestro/helpers/compare_screenshots.js ios
283+
# - name: "Compare iOS screenshots"
284+
# continue-on-error: true
285+
# run: node ${{ github.workspace }}/maestro/helpers/compare_screenshots.js ios
318286

319-
- name: "Archive diff results"
320-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
321-
with:
322-
name: screenshot-diffs
323-
path: maestro/tests/images/diffs/
324-
if-no-files-found: ignore
287+
# - name: "Archive diff results"
288+
# uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
289+
# with:
290+
# name: screenshot-diffs
291+
# path: maestro/tests/images/diffs/
292+
# if-no-files-found: ignore
325293

326-
- name: "Archive comparison results"
327-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
328-
with:
329-
name: comparison-results
330-
path: compare_output.txt
331-
if-no-files-found: ignore
294+
# - name: "Archive comparison results"
295+
# uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
296+
# with:
297+
# name: comparison-results
298+
# path: compare_output.txt
299+
# if-no-files-found: ignore
332300

333-
- name: "Fail if comparisons failed"
334-
run: |
335-
if [ "$ANDROID_COMPARISON_FAILED" == "true" ] || [ "$IOS_COMPARISON_FAILED" == "true" ]; then
336-
echo "One or more comparisons failed."
337-
exit 1
338-
fi
301+
# - name: "Fail if comparisons failed"
302+
# run: |
303+
# if [ "$ANDROID_COMPARISON_FAILED" == "true" ] || [ "$IOS_COMPARISON_FAILED" == "true" ]; then
304+
# echo "One or more comparisons failed."
305+
# exit 1
306+
# fi

android/fastlane/Fastfile

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ platform :android do
5555

5656
desc "Build new bundle and upload to Internal track"
5757
lane :internal do |options|
58+
UI.message "GOOGLE_PLAY_VERSION: #{GOOGLE_PLAY_VERSION.inspect}"
59+
UI.message "BUILD_NUMBER: #{BUILD_NUMBER.inspect}"
5860
FileUtils.copy(ORIGINAL_CHANGELOG_PATH, FASTLANE_CHANGELOG_PATH)
5961
versionCode = google_play_track_version_codes(track: "internal", json_key: ENV["PLAY_STORE_CREDENTIALS_PATH"]).max() + 1
60-
versionName = GOOGLE_PLAY_VERSION + "." + BUILD_NUMBER
61-
# versionCode = 1
62-
# versionName = BUILD_NUMBER
62+
#versionName = GOOGLE_PLAY_VERSION + "." + BUILD_NUMBER
63+
google_play_version = GOOGLE_PLAY_VERSION || "1.0"
64+
build_number = BUILD_NUMBER || "1"
65+
versionName = "#{google_play_version}.#{build_number}"
6366

6467

6568
gradleOptions = {
@@ -100,10 +103,20 @@ platform :android do
100103
)
101104
else
102105
UI.message "Building APK version #{versionName}(#{versionCode}) for internal tests"
103-
UI.message "Checking if keystore file exists at: #{ENV['ANDROID_KEYSTORE_PATH']}"
104-
sh("ls -l #{ENV['ANDROID_KEYSTORE_PATH']}")
105-
UI.message "ANDROID_KEYSTORE_PATH: #{ENV['ANDROID_KEYSTORE_PATH']}"
106-
UI.message "ANDROID_KEYSTORE_ALIAS: #{ENV['ANDROID_KEYSTORE_ALIAS']}"
106+
# Add detailed keystore debugging info
107+
UI.message "Android Keystore Debug Info:"
108+
UI.message "ANDROID_KEYSTORE_PATH exists: #{File.exist?(ENV["ANDROID_KEYSTORE_PATH"])}"
109+
UI.message "ANDROID_KEYSTORE_PATH size: #{File.size(ENV["ANDROID_KEYSTORE_PATH"])} bytes" if File.exist?(ENV["ANDROID_KEYSTORE_PATH"])
110+
UI.message "ANDROID_KEYSTORE_ALIAS: #{ENV["ANDROID_KEYSTORE_ALIAS"]}"
111+
112+
# Try to verify the keystore using a subprocess to catch any failures
113+
begin
114+
sh("keytool -list -keystore \"#{ENV["ANDROID_KEYSTORE_PATH"]}\" -storepass \"#{ENV["ANDROID_KEYSTORE_PASSWORD"]}\" -alias \"#{ENV["ANDROID_KEYSTORE_ALIAS"]}\" > /dev/null 2>&1")
115+
UI.success "Keystore verification passed!"
116+
rescue => e
117+
UI.error "Keystore verification failed: #{e.message}"
118+
# Continue the build anyway - this is just for debugging
119+
end
107120
#Build APK
108121
gradle(
109122
task: "assemble",

0 commit comments

Comments
 (0)