Skip to content

Commit af51267

Browse files
committed
multi: CI changes for redwallet fork
1 parent 7614013 commit af51267

3 files changed

Lines changed: 128 additions & 17 deletions

File tree

.github/workflows/build-ios-release-pullrequest.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,38 @@ jobs:
290290
run: |
291291
bundle exec fastlane ios setup_provisioning_profiles
292292
293+
- name: Build App (unsigned, non-master)
294+
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/2025-12-03-redwallet'
295+
run: |
296+
cd ios && pod install
297+
mkdir -p build_logs
298+
xcodebuild -workspace BlueWallet.xcworkspace \
299+
-scheme BlueWallet \
300+
-configuration Release \
301+
-sdk iphonesimulator \
302+
-destination 'generic/platform=iOS Simulator' \
303+
-derivedDataPath build \
304+
CODE_SIGNING_ALLOWED=NO \
305+
build 2>&1 | tee build_logs/xcodebuild.log
306+
307+
- name: Upload unsigned app as artifact
308+
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/2025-12-03-redwallet'
309+
uses: actions/upload-artifact@v4
310+
with:
311+
name: BlueWallet-unsigned-simulator
312+
path: ios/build/Build/Products/Release-iphonesimulator/BlueWallet.app
313+
retention-days: 7
314+
if-no-files-found: error
315+
316+
- name: Upload build logs (non-master)
317+
if: always() && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/2025-12-03-redwallet'
318+
uses: actions/upload-artifact@v4
319+
with:
320+
name: build_logs_pr
321+
path: ios/build_logs/xcodebuild.log
322+
retention-days: 7
323+
if-no-files-found: error
324+
293325
- name: Build App
294326
id: build_app
295327
run: |
@@ -435,6 +467,7 @@ jobs:
435467
name: build_logs
436468
path: ./ios/build_logs/
437469
retention-days: 7
470+
if-no-files-found: warn
438471

439472
- name: Verify IPA File Before Upload
440473
run: |

.github/workflows/build-release-apk.yml

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@ jobs:
8282
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" >> $GITHUB_ENV
8383
echo "build_number=$NEW_BUILD_NUMBER" >> $GITHUB_OUTPUT
8484
85+
<<<<<<< HEAD
8586
- name: Build and sign APK
8687
id: build_and_sign_apk
8788
run: bundle exec fastlane android build_release_apk
89+
=======
90+
- name: Build release AAB
91+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet'
92+
id: build_release_aab
93+
run: bundle exec fastlane android build_release_aab
94+
>>>>>>> 81bdf7f92 (ci: automatically upload android builds to Play Store internal testing)
8895
env:
8996
BUILD_NUMBER: ${{ steps.build_number.outputs.build_number }}
9097
KEYSTORE_FILE_HEX: ${{ secrets.KEYSTORE_FILE_HEX }}
@@ -103,29 +110,34 @@ jobs:
103110
android/**/reports/**/*.log
104111
if-no-files-found: warn
105112

106-
- name: Determine APK Filename and Path
107-
id: determine_apk_path
113+
- name: Build Debug APK (non-master branches)
114+
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/2025-12-03-redwallet'
115+
run: |
116+
cd android && ./gradlew assembleDebug --no-daemon
117+
118+
- name: Determine AAB Filename and Path
119+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet'
120+
id: determine_aab_path
108121
run: |
109122
BUILD_NUMBER=${{ steps.build_number.outputs.build_number }}
110123
VERSION_NAME=$(grep versionName android/app/build.gradle | awk '{print $2}' | tr -d '"')
111124
BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}
112125
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9_-]/_/g')
113126
114127
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then
115-
EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}-${BRANCH_NAME}.apk"
128+
EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}-${BRANCH_NAME}.aab"
116129
else
117-
EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}.apk"
130+
EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}.aab"
118131
fi
119-
120-
APK_PATH="android/app/build/outputs/apk/release/${EXPECTED_FILENAME}"
121-
echo "EXPECTED_FILENAME=${EXPECTED_FILENAME}" >> $GITHUB_ENV
122-
echo "APK_PATH=${APK_PATH}" >> $GITHUB_ENV
132+
AAB_PATH="android/app/build/outputs/bundle/release/${EXPECTED_FILENAME}"
133+
echo "AAB_PATH=${AAB_PATH}" >> $GITHUB_ENV
123134
124-
- name: Upload APK as artifact
125-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
135+
- name: Upload signed AAB as artifact
136+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet'
137+
uses: actions/upload-artifact@v4
126138
with:
127-
name: signed-apk
128-
path: ${{ env.APK_PATH }}
139+
name: signed-aab
140+
path: ${{ env.AAB_PATH }}
129141
if-no-files-found: error
130142

131143
browserstack:
@@ -146,20 +158,54 @@ jobs:
146158
- name: Install dependencies with Bundler
147159
run: bundle install --jobs 4 --retry 3
148160

149-
- name: Download APK artifact
150-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
161+
- name: Download AAB artifact
162+
uses: actions/download-artifact@v4
151163
with:
152-
name: signed-apk
164+
name: signed-aab
153165

154166
- name: Set APK Path
155167
run: |
156-
APK_PATH=$(find ${{ github.workspace }} -name '*.apk')
168+
APK_PATH=$(find ${{ github.workspace }} -name '*.aab')
157169
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
158170
159-
- name: Upload APK to BrowserStack and Post PR Comment
171+
- name: Upload AAB to BrowserStack and Post PR Comment
160172
env:
161173
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
162174
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
163175
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
164176
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
165177
run: bundle exec fastlane upload_to_browserstack_and_comment
178+
179+
play-store-upload:
180+
runs-on: ubuntu-latest
181+
needs: buildReleaseApk
182+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet')
183+
184+
steps:
185+
- name: Checkout code
186+
uses: actions/checkout@v4
187+
188+
- name: Set up Ruby
189+
uses: ruby/setup-ruby@v1
190+
with:
191+
ruby-version: 3.1.6
192+
bundler-cache: true
193+
194+
- name: Install dependencies with Bundler
195+
run: bundle install --jobs 4 --retry 3
196+
197+
- name: Download AAB artifact
198+
uses: actions/download-artifact@v4
199+
with:
200+
name: signed-aab
201+
202+
- name: Set AAB Path
203+
run: |
204+
AAB_PATH=$(find ${{ github.workspace }} -name '*.aab')
205+
echo "AAB_PATH=$AAB_PATH" >> $GITHUB_ENV
206+
207+
- name: Upload to Google Play Internal Testing
208+
env:
209+
GOOGLE_PLAY_JSON_KEY: ${{ secrets.GOOGLE_PLAY_JSON_KEY }}
210+
AAB_PATH: ${{ env.AAB_PATH }}
211+
run: bundle exec fastlane android deploy_to_play_store

fastlane/Fastfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,38 @@ platform :android do
310310
end
311311
end
312312

313+
desc "Upload AAB to Google Play internal/closed testing"
314+
lane :deploy_to_play_store do
315+
Dir.chdir(PROJECT_ROOT) do
316+
aab_path = ENV['AAB_PATH']
317+
318+
if aab_path.nil? || aab_path.empty?
319+
UI.message("No AAB path provided, searching for AAB...")
320+
aab_path = Dir.glob(File.join(PROJECT_ROOT, "android/app/build/outputs/bundle/release/*.aab")).last
321+
UI.user_error!("No AAB file found") if aab_path.nil? || aab_path.empty?
322+
end
323+
324+
# Ensure absolute path
325+
aab_path = File.expand_path(aab_path, PROJECT_ROOT) unless aab_path.start_with?('/')
326+
327+
UI.user_error!("AAB file not found at: #{aab_path}") unless File.exist?(aab_path)
328+
UI.message("Uploading AAB to Play Store: #{aab_path}")
329+
330+
upload_to_play_store(
331+
track: "internal",
332+
aab: aab_path,
333+
json_key_data: ENV['GOOGLE_PLAY_JSON_KEY'],
334+
package_name: "com.layertwolabs.bluewallet",
335+
skip_upload_metadata: true,
336+
skip_upload_images: true,
337+
skip_upload_screenshots: true,
338+
skip_upload_changelogs: true
339+
)
340+
341+
UI.success("Successfully uploaded AAB to Play Store internal track!")
342+
end
343+
end
344+
313345
desc "Upload APK to BrowserStack and post result as PR comment"
314346
lane :upload_to_browserstack_and_comment do
315347
Dir.chdir(PROJECT_ROOT) do

0 commit comments

Comments
 (0)