From a09b2ffdb3dd3ab8d378bc23553fb34d7a1f0126 Mon Sep 17 00:00:00 2001 From: MohitMali Date: Fri, 10 Nov 2023 11:55:14 +0530 Subject: [PATCH] Storing dummy bundle on github workflow. * We have enhanced `publish.yml` to storing dummy bundle in workflow, for this we needs to add `"new": true` in info.json file. * We have modify our `README.md` file to document this. --- .github/workflows/publish.yml | 60 ++++++++++++++++++++++++++++++++++- README.md | 1 + 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0575f5f..270e08d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,4 +39,62 @@ jobs: DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }} run: | cd kiwix-android - eval "./gradlew publish${TAG^}ReleaseApkWithExpansionFile" + eval "./gradlew publish${TAG^}ReleaseBundleWithPlayAssetDelivery" + + publish_dummy_bundle: + runs-on: ubuntu-22.04 + + steps: + - name: Retrieving custom app configuration + uses: actions/checkout@v3 + + - name: Retrieving Kiwix Android source code + run: git clone --depth=1 --single-branch --branch develop https://github.com/kiwix/kiwix-android.git + + - name: Copying custom app configuration into Kiwix Android code base + run: ./copy_files_to_kiwix_android.sh + + - name: Preparing signing material + env: + keystore: ${{ secrets.keystore }} + run: | + echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore + + - name: Set tag variable + run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV + + - name: Should upload dummy Bundle + run: | + cd ${TAG} + new=$(grep -o '"new": true' info.json) + if [ -n "$new" ]; then + echo "The 'new' attribute is true, proceeding to publish dummy bundle..." + else + echo "The 'new' attribute is not true, skipping the next job." + exit 0 # Skip the job as Bundle is already published on play store + fi + + - name: Generate dummy Bundle + env: + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} + DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }} + run: | + cd kiwix-android + eval "./gradlew bundle${TAG^}Release" + + + - name: Get Bundle name and path + id: bundle-path + run: | + BUNDLE_PATH="kiwix-android/custom/build/outputs/bundle/${TAG}Release/*${TAG}*.aab" + BUNDLE_NAME="${TAG^}DummyBundle.aab" + echo "::set-output name=bundle_path::$BUNDLE_PATH" + echo "::set-output name=bundle_name::$BUNDLE_NAME" + + - name: Upload Bundle as an artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.bundle-path.outputs.bundle_name }} + path: ${{ steps.bundle-path.outputs.bundle_path }} \ No newline at end of file diff --git a/README.md b/README.md index db1a64a..11c5f62 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ important fields are: - `disable_sidebar`, a boolean value, when set to `true`, it hides the sidebar - `disable_tabs`, a boolean value, when set to `true`, it deactivates the multi-tabs feature - `disable_read_aloud`, a boolean value, when set to `true`, it disable the text-to-speech feature +- `new`, A boolean value, when set to `true`, it triggers the creation and storage of a dummy release Bundle during the current workflow run. You can also create this new file using Github IO. Go to https://github.com/kiwix/kiwix-android-custom/new/master and type