Skip to content

Commit 887d543

Browse files
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.
1 parent 9b9d19f commit 887d543

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/testing_release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
tags:
99
- 'internal_testing' # internal_testing Tag
10+
- 'internal_testing_v*' # Dynamic date tag for internal testing
1011

1112
jobs:
1213
publish:
@@ -29,10 +30,21 @@ jobs:
2930
echo "$KEYSTORE" | base64 -d > kiwix-android.keystore
3031
echo "$PLAYSTORE_JSON" > playstore.json
3132
33+
- name: Retrieve date from TAG
34+
id: extract_date
35+
run: |
36+
if [[ "${GITHUB_REF}" =~ internal_testing_v([0-9]{4}-[0-9]{2}-[0-9]{2}) ]]; then
37+
RELEASE_DATE="${BASH_REMATCH[1]}"
38+
else
39+
RELEASE_DATE=""
40+
fi
41+
echo "KIWIX_ANDROID_RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_ENV
42+
3243
- name: Publish bundle in internal testing on Google Play
3344
env:
3445
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
3546
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
3647
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
48+
KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }}
3749
run: |
3850
./gradlew publishPlayStoreBundle --scan

0 commit comments

Comments
 (0)