From ae7988f112aee7ac541877b15e149272e23818c1 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Fri, 3 Jan 2025 11:23:40 +0530 Subject: [PATCH] Refactored `testing_release` CD workflow to generate and publish the application on the Play Store based on a specified date, using a new tag format `internal_testing_v*` where `*` is replaced by the date, which is extracted and set as an environment variable to generate the app bundle for that date, defaulting to the current date if no date is provided, and uploading the generated app bundle to the Play Store. --- .github/workflows/testing_release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/testing_release.yml b/.github/workflows/testing_release.yml index 393370a4a..f68656fd2 100644 --- a/.github/workflows/testing_release.yml +++ b/.github/workflows/testing_release.yml @@ -7,6 +7,7 @@ on: push: tags: - 'internal_testing' # internal_testing Tag + - 'internal_testing_v*' # Dynamic date tag for internal testing jobs: publish: @@ -29,10 +30,21 @@ jobs: echo "$KEYSTORE" | base64 -d > kiwix-android.keystore echo "$PLAYSTORE_JSON" > playstore.json + - name: Retrieve date from TAG + id: extract_date + run: | + if [[ "${GITHUB_REF}" =~ internal_testing_v([0-9]{4}-[0-9]{2}-[0-9]{2}) ]]; then + RELEASE_DATE="${BASH_REMATCH[1]}" + else + RELEASE_DATE="" + fi + echo "KIWIX_ANDROID_RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_ENV + - name: Publish bundle in internal testing on Google Play env: KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} + KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }} run: | ./gradlew publishPlayStoreBundle --scan