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.

This commit is contained in:
MohitMaliFtechiz 2025-01-03 11:23:40 +05:30
parent caa45c5f51
commit ae7988f112

View File

@ -7,6 +7,7 @@ on:
push: push:
tags: tags:
- 'internal_testing' # internal_testing Tag - 'internal_testing' # internal_testing Tag
- 'internal_testing_v*' # Dynamic date tag for internal testing
jobs: jobs:
publish: publish:
@ -29,10 +30,21 @@ jobs:
echo "$KEYSTORE" | base64 -d > kiwix-android.keystore echo "$KEYSTORE" | base64 -d > kiwix-android.keystore
echo "$PLAYSTORE_JSON" > playstore.json 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 - name: Publish bundle in internal testing on Google Play
env: env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }}
run: | run: |
./gradlew publishPlayStoreBundle --scan ./gradlew publishPlayStoreBundle --scan