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
0 commit comments