From ac5dda9d220652b825833fe965da96e5e4560265 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Sat, 5 Jul 2025 14:59:05 +0530 Subject: [PATCH] Added support to build custom apps from a specific `revision ID`. * Added the `kiwix-android_revision` field to the `info.json` file. If this field is set to `latest` or an `empty` string, the latest commit from the `kiwix-android` main branch will be used to build the application. Otherwise, if a valid commit SHA is provided, the custom app will be built using the codebase from that specific commit. * Updated the README file to reflect this change. --- .github/workflows/cd.yml | 44 ++++++++++++++++++++++++++++++++++++-- README.md | 3 +++ afconpedia/info.json | 3 ++- bollywood/info.json | 3 ++- canpedia/info.json | 3 ++- dwds/info.json | 3 ++- phet/info.json | 3 ++- sample_app/info.json | 3 ++- tunisie/info.json | 3 ++- venezuela/info.json | 3 ++- wikimania/info.json | 3 ++- wikimed/info.json | 3 ++- wikimedar/info.json | 3 ++- wikimedde/info.json | 3 ++- wikimedes/info.json | 3 ++- wikimedfa/info.json | 3 ++- wikimedfr/info.json | 3 ++- wikimedja/info.json | 3 ++- wikimedmini/info.json | 3 ++- wikimedor/info.json | 3 ++- wikimedpt/info.json | 3 ++- wikimeduk/info.json | 3 ++- wikimedzh/info.json | 3 ++- wikispecies/info.json | 3 ++- wikivoyage/info.json | 3 ++- wikivoyagede/info.json | 3 ++- wikivoyageeurope/info.json | 3 ++- wiktionaryar/info.json | 3 ++- wpbm/info.json | 3 ++- 29 files changed, 99 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1992828..c8c1609 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,8 +20,28 @@ jobs: java-version: 17 distribution: temurin + - name: Read revision ID from info.json + run: | + cd ${TAG} + rev_id=$(jq -r '.kiwix-android_revision // empty' info.json) + if [ -z "$rev_id" ]; then + echo "REV_ID=" >> $GITHUB_ENV + else + echo "REV_ID=$rev_id" >> $GITHUB_ENV + fi + - name: Retrieving Kiwix Android source code - run: git clone --depth=1 --single-branch --branch main https://github.com/kiwix/kiwix-android.git + run: | + if [ -z "${{ env.REV_ID }}" ]; then + echo "Cloning latest commit from main branch" + git clone --depth=1 --single-branch --branch main https://github.com/kiwix/kiwix-android.git + else + echo "Cloning specific commit: ${{ env.REV_ID }}" + git clone https://github.com/kiwix/kiwix-android.git + cd kiwix-android + git checkout ${{ env.REV_ID }} + cd .. + fi - name: Copying custom app configuration into Kiwix Android code base run: ./copy_files_to_kiwix_android.sh @@ -88,8 +108,28 @@ jobs: java-version: 17 distribution: temurin + - name: Read revision ID from info.json + run: | + cd ${TAG} + rev_id=$(jq -r '.kiwix-android_revision // empty' info.json) + if [ -z "$rev_id" ]; then + echo "REV_ID=" >> $GITHUB_ENV + else + echo "REV_ID=$rev_id" >> $GITHUB_ENV + fi + - name: Retrieving Kiwix Android source code - run: git clone --depth=1 --single-branch --branch main https://github.com/kiwix/kiwix-android.git + run: | + if [ -z "${{ env.REV_ID }}" ]; then + echo "Cloning latest commit from main branch" + git clone --depth=1 --single-branch --branch main https://github.com/kiwix/kiwix-android.git + else + echo "Cloning specific commit: ${{ env.REV_ID }}" + git clone https://github.com/kiwix/kiwix-android.git + cd kiwix-android + git checkout ${{ env.REV_ID }} + cd .. + fi - name: Copying custom app configuration into Kiwix Android code base run: ./copy_files_to_kiwix_android.sh diff --git a/README.md b/README.md index 0373a9e..34ab8bb 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ important fields are: run. - `upload_bundle` A boolean value. When set to true, it uploads the bundle to the Play Store, Otherwise, it uploads the APK. +- `kiwix-android_revision` A specific Git commit SHA (revision ID) of the `kiwix-android` repository to use when building the app. + - If this field is set to an `empty` string or `latest`, the latest commit from the `main` branch will be used. + - If this field contains a valid commit SHA, that specific version of the `kiwix-android` code base will be used for the build. You can also create this new file using Github IO. Go to https://github.com/kiwix/kiwix-android-custom/new/main and type diff --git a/afconpedia/info.json b/afconpedia/info.json index fc8b2b9..cd48bee 100644 --- a/afconpedia/info.json +++ b/afconpedia/info.json @@ -3,5 +3,6 @@ "zim_url": "https://drive.farm.openzim.org/custom%20apps/CAN%20App%20-%20English/All%20Articles%20/CANAllArticlesEN-1ed6e94c6348_2024-01.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } \ No newline at end of file diff --git a/bollywood/info.json b/bollywood/info.json index 85af828..2de1ce3 100644 --- a/bollywood/info.json +++ b/bollywood/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/wikipedia/wikipedia_en_indian_cinema_nopic_2023-12.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } \ No newline at end of file diff --git a/canpedia/info.json b/canpedia/info.json index 09d0562..9999b81 100644 --- a/canpedia/info.json +++ b/canpedia/info.json @@ -3,5 +3,6 @@ "zim_url": "https://drive.farm.openzim.org/custom%20apps/CAN%20App%20-%20French/All%20Articles%20-%20FR/CANAllArticlesFR-4546453e6f9d_2024-01.zim", "enforced_lang": "fr", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } \ No newline at end of file diff --git a/dwds/info.json b/dwds/info.json index 5fe2ad9..f63513e 100644 --- a/dwds/info.json +++ b/dwds/info.json @@ -6,5 +6,6 @@ "disable_title": true, "disable_external_links": true, "about_app_url": "https://www.dwds.de/a/", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/phet/info.json b/phet/info.json index 8268b18..3631fee 100644 --- a/phet/info.json +++ b/phet/info.json @@ -6,5 +6,6 @@ "disable_tabs": true, "disable_read_aloud": true, "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/sample_app/info.json b/sample_app/info.json index 7399884..b273e4a 100644 --- a/sample_app/info.json +++ b/sample_app/info.json @@ -6,5 +6,6 @@ "ic_launcher": "icon.png", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/tunisie/info.json b/tunisie/info.json index 82bbe39..bb29405 100644 --- a/tunisie/info.json +++ b/tunisie/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_fr_tunisie-app_maxi_2023-12.zim", "enforced_lang": "fr", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/venezuela/info.json b/venezuela/info.json index dfd47d4..aac9f1b 100644 --- a/venezuela/info.json +++ b/venezuela/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_es_venezuela-app_maxi_2023-12.zim", "enforced_lang": "es", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimania/info.json b/wikimania/info.json index 29dbba6..e303569 100644 --- a/wikimania/info.json +++ b/wikimania/info.json @@ -3,5 +3,6 @@ "zim_url": "https://drive.farm.openzim.org/custom%20apps/wikimania/wikimania_en_2025-07.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimed/info.json b/wikimed/info.json index 40b7708..3a7d384 100644 --- a/wikimed/info.json +++ b/wikimed/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/mdwiki_en_all-app_maxi_2024-05.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": false + "upload_bundle": false, + "kiwix-android_revision": "latest" } diff --git a/wikimedar/info.json b/wikimedar/info.json index a3323a4..e8de7a5 100644 --- a/wikimedar/info.json +++ b/wikimedar/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_ar_medicine-app_maxi_2023-12.zim", "enforced_lang": "ar", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedde/info.json b/wikimedde/info.json index e4fb191..85b09c8 100644 --- a/wikimedde/info.json +++ b/wikimedde/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_de_medicine-app_maxi_2024-05.zim", "enforced_lang": "de", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedes/info.json b/wikimedes/info.json index eeb6238..1c11749 100644 --- a/wikimedes/info.json +++ b/wikimedes/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_es_medicine-app_maxi_2023-12.zim", "enforced_lang": "es", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedfa/info.json b/wikimedfa/info.json index 2c32df3..dcb4d7c 100644 --- a/wikimedfa/info.json +++ b/wikimedfa/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_fa_medicine-app_maxi_2023-12.zim", "enforced_lang": "fa", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedfr/info.json b/wikimedfr/info.json index bb832d3..85db2f1 100644 --- a/wikimedfr/info.json +++ b/wikimedfr/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_fr_medicine-app_maxi_2024-05.zim", "enforced_lang": "fr", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedja/info.json b/wikimedja/info.json index ccf09dd..b972842 100644 --- a/wikimedja/info.json +++ b/wikimedja/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_ja_medicine-app_maxi_2023-12.zim", "enforced_lang": "ja", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedmini/info.json b/wikimedmini/info.json index d0d0b85..a41fe27 100644 --- a/wikimedmini/info.json +++ b/wikimedmini/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/mdwiki_en_all-app_mini_2023-12.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedor/info.json b/wikimedor/info.json index 8340852..f9226f2 100644 --- a/wikimedor/info.json +++ b/wikimedor/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_or_medicine-app_maxi_2023-12.zim", "enforced_lang": "or", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimedpt/info.json b/wikimedpt/info.json index f279b30..0d6f301 100644 --- a/wikimedpt/info.json +++ b/wikimedpt/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_pt_medicine-app_maxi_2023-12.zim", "enforced_lang": "pt", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikimeduk/info.json b/wikimeduk/info.json index 1166ec4..63c4988 100644 --- a/wikimeduk/info.json +++ b/wikimeduk/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_uk_medicine-app_maxi_2023-12.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } \ No newline at end of file diff --git a/wikimedzh/info.json b/wikimedzh/info.json index a99acbf..e153205 100644 --- a/wikimedzh/info.json +++ b/wikimedzh/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikipedia_zh_medicine-app_maxi_2023-12.zim", "enforced_lang": "zh", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikispecies/info.json b/wikispecies/info.json index f6bfd88..e37b54a 100644 --- a/wikispecies/info.json +++ b/wikispecies/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikispecies_en_all-app_maxi_2023-12.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": false + "upload_bundle": false, + "kiwix-android_revision": "latest" } diff --git a/wikivoyage/info.json b/wikivoyage/info.json index fac8ab8..4215e26 100644 --- a/wikivoyage/info.json +++ b/wikivoyage/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikivoyage_en_all-app_maxi_2024-06.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikivoyagede/info.json b/wikivoyagede/info.json index b059ab8..bf982e2 100644 --- a/wikivoyagede/info.json +++ b/wikivoyagede/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/wikivoyage/wikivoyage_de_all_maxi_2024-06.zim", "enforced_lang": "de", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wikivoyageeurope/info.json b/wikivoyageeurope/info.json index 91a2d51..68d16eb 100644 --- a/wikivoyageeurope/info.json +++ b/wikivoyageeurope/info.json @@ -3,5 +3,6 @@ "zim_url": "https://mirror.download.kiwix.org/zim/.hidden/custom_apps/wikivoyage_en_europe-app_maxi_2024-06.zim", "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" } diff --git a/wiktionaryar/info.json b/wiktionaryar/info.json index 63e0211..cfc544b 100644 --- a/wiktionaryar/info.json +++ b/wiktionaryar/info.json @@ -4,5 +4,6 @@ "enforced_lang": "en", "support_url": "https://www.kiwix.org/support", "upload_bundle": true, - "new": false + "new": false, + "kiwix-android_revision": "latest" } \ No newline at end of file diff --git a/wpbm/info.json b/wpbm/info.json index 8d30efb..e31c045 100644 --- a/wpbm/info.json +++ b/wpbm/info.json @@ -40,5 +40,6 @@ "zim_url": "https://download.kiwix.org/zim/wikipedia/wikipedia_bm_all_maxi_2019-10.zim", "enforced_lang": "bm", "support_url": "https://www.kiwix.org/support", - "upload_bundle": true + "upload_bundle": true, + "kiwix-android_revision": "latest" }