@@ -138,6 +138,22 @@ jobs:
138138 az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
139139 --name authenticator_play_firebase-creds.json --file ${{ github.workspace }}/secrets/authenticator_play_firebase-creds.json --output none
140140
141+ - name : Download Play Store credentials
142+ if : ${{ inputs.publish-to-play-store }}
143+ env :
144+ ACCOUNT_NAME : bitwardenci
145+ CONTAINER_NAME : mobile
146+ run : |
147+ mkdir -p ${{ github.workspace }}/secrets
148+
149+ az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
150+ --name authenticator_play_store-creds.json --file ${{ github.workspace }}/secrets/authenticator_play_store-creds.json --output none
151+
152+ - name : Verify Play Store credentials
153+ if : ${{ inputs.publish-to-play-store }}
154+ run : |
155+ bundle exec fastlane run validate_play_store_json_key
156+
141157 - name : Validate Gradle wrapper
142158 uses : gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
143159
@@ -167,14 +183,19 @@ jobs:
167183 java-version : ${{ env.JAVA_VERSION }}
168184
169185 - name : Increment version
170- env :
171- FIREBASE_CREDS_PATH : ${{ github.workspace }}/secrets/authenticator_play_firebase-creds.json
172186 run : |
173187 DEFAULT_VERSION_CODE=$GITHUB_RUN_NUMBER
188+ VERSION_CODE="${{ inputs.version-code || '$DEFAULT_VERSION_CODE' }}"
174189 bundle exec fastlane setBuildVersionInfo \
175- serviceCredentialsFile:${{ env.FIREBASE_CREDS_PATH }} \
176- versionCode:${{ inputs.version-code || '$DEFAULT_VERSION_CODE' }} \
177- versionName:${{ inputs.version-name }}
190+ versionCode:$VERSION_CODE \
191+ versionName:${{ inputs.version-name || '' }}
192+
193+ regex='versionName = "([^"]+)"'
194+ if [[ "$(cat app/build.gradle.kts)" =~ $regex ]]; then
195+ VERSION_NAME="${BASH_REMATCH[1]}"
196+ fi
197+ echo "Version Name: ${VERSION_NAME}" >> $GITHUB_STEP_SUMMARY
198+ echo "Version Number: $VERSION_CODE" >> $GITHUB_STEP_SUMMARY
178199
179200 - name : Generate release Play Store bundle
180201 if : ${{ matrix.variant == 'aab' }}
@@ -255,7 +276,7 @@ jobs:
255276 - name : Publish release bundle to Google Play Store
256277 if : ${{ inputs.publish-to-play-store && matrix.variant == 'aab' }}
257278 env :
258- PLAY_STORE_CREDS_FILE : ${{ github.workspace }}/secrets/authenticator_play_firebase -creds.json
279+ PLAY_STORE_CREDS_FILE : ${{ github.workspace }}/secrets/authenticator_play_store -creds.json
259280 run : |
260281 bundle exec fastlane publishReleaseToGooglePlayStore \
261282 serviceCredentialsFile:${{ env.PLAY_STORE_CREDS_FILE }} \
0 commit comments