From befd7d389ada16cfaa6af3cba05bbe2615b78dbd Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Sat, 4 Jan 2025 16:24:47 +0530 Subject: [PATCH] The testing_release job is skipped, if the application is being uploaded with the same version as the previously uploaded one, and Play Store gives the error for same version code. This prevents the CD pipeline from failing due to this error, while for all other errors, the workflow will fail as expected. --- .github/workflows/testing_release.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing_release.yml b/.github/workflows/testing_release.yml index de0590758..93792a106 100644 --- a/.github/workflows/testing_release.yml +++ b/.github/workflows/testing_release.yml @@ -49,4 +49,16 @@ jobs: KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }} run: | - ./gradlew publishPlayStoreBundle --scan + OUTPUT=$(./gradlew publishPlayStoreBundle --scan 2>&1) + echo "$OUTPUT" > gradle_output.log + if echo "$OUTPUT" | grep -q "BUILD SUCCESSFUL"; then + echo "$OUTPUT" + exit 0 + fi + + if echo "$OUTPUT" | grep -q "Try another version code."; then + echo "Upload skipped because very same version. $OUTPUT" + exit 0 + fi + echo "$OUTPUT" + exit 1