[android] Separate GPlay and F-Droid metadata checks

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-09-11 22:05:59 +07:00
parent 886c094d77
commit 3e9c142b72
3 changed files with 31 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
name: Android Check Metadata
name: Android Check Store Metadata
on:
workflow_dispatch: # Manual trigger
pull_request:
@@ -21,5 +21,8 @@ jobs:
android
tools/python/check_store_metadata.py
- name: Check metadata
run: ./tools/python/check_store_metadata.py android
- name: Check Google Play metadata
run: ./tools/python/check_store_metadata.py gplay
- name: Check F-Droid metadata
run: ./tools/python/check_store_metadata.py fdroid

View File

@@ -8,21 +8,19 @@ jobs:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout sources
# TODO: use shallow (and sparse?) checkout
- name: Checkout
uses: actions/checkout@v4
# - name: Parallel submodules checkout
# shell: bash
# run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
with:
fetch-depth: 1
sparse-checkout: |
android
tools/python/check_store_metadata.py
- name: Restore release keys
shell: bash
run: |
echo "$PRIVATE_H" | base64 -d > private.h
echo "$GOOGLE_PLAY_JSON" | base64 -d > android/app/google-play.json
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
GOOGLE_PLAY_JSON: ${{ secrets.GOOGLE_PLAY_JSON }}
- name: Upload

View File

@@ -164,28 +164,28 @@ def check_exact(path, expected):
return done(path, ok)
def check_android():
def check_android(is_gplay):
ok = True
flavor = 'android/app/src/fdroid/play/'
flavor = "google" if is_gplay else "fdroid"
flavor = f'android/app/src/{flavor}/play/'
ok = check_url(flavor + 'contact-website.txt') and ok
ok = check_email(flavor + 'contact-email.txt') and ok
ok = check_exact(flavor + 'default-language.txt', 'en-US') and ok
for locale in glob.glob(flavor + 'listings/*/'):
if locale.split('/')[-2] not in GPLAY_LOCALES:
if is_gplay and locale.split('/')[-2] not in GPLAY_LOCALES:
ok = error(locale, 'unsupported locale') and ok
continue
ok = check_text(locale + 'title.txt', 50) and ok
ok = check_text(locale + 'title-google.txt', 30) and ok
ok = check_text(locale + 'title.txt', 30 if is_gplay else 50) and ok
ok = check_text(locale + 'short-description.txt', 80) and ok
ok = check_text(locale + 'short-description-google.txt', 80, True) and ok
ok = check_text(locale + 'full-description.txt', 4000) and ok
ok = check_text(locale + 'full-description-google.txt', 4000, True) and ok
ok = check_text(locale + 'release-notes.txt', 499) and ok
ok = check_text(locale + 'release-notes.txt', 499, optional=True) and ok
''' TODO: relnotes not necessary exist for all languages, but symlinks are made for all
for locale in glob.glob(flavor + 'release-notes/*/'):
if locale.split('/')[-2] not in GPLAY_LOCALES:
ok = error(locale, 'unsupported locale') and ok
continue
ok = check_text(locale + 'default.txt', 499) and ok
'''
return ok
@@ -215,8 +215,12 @@ def check_ios():
if __name__ == "__main__":
ok = True
if len(sys.argv) == 2 and sys.argv[1] == 'android':
if check_android():
if len(sys.argv) == 2 and sys.argv[1] == 'gplay':
if check_android(is_gplay=True):
sys.exit(0)
sys.exit(2)
if len(sys.argv) == 2 and sys.argv[1] == 'fdroid':
if check_android(is_gplay=False):
sys.exit(0)
sys.exit(2)
elif len(sys.argv) == 2 and sys.argv[1] == "ios":
@@ -224,5 +228,5 @@ if __name__ == "__main__":
sys.exit(0)
sys.exit(2)
else:
print("Usage:", sys.argv[0], "android|ios", file=sys.stderr)
print("Usage:", sys.argv[0], "gplay|fdroid|ios", file=sys.stderr)
sys.exit(1)