[multimedia/kid3] android: CI: Adapt to expected contents of Android fastlane-org.kde.kid3.zip
Urs Fleisch <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 24ab2d769e42c909714042dad46e4a0397721b77 by Urs Fleisch.
Committed on 27/07/2026 at 18:58.
Pushed by ufleisch into branch 'master'.
CI: Adapt to expected contents of Android fastlane-org.kde.kid3.zip
M +20 -5 android/fdroid2fastlane.py
https://invent.kde.org/multimedia/kid3/-/commit/24ab2d769e42c909714042dad46e4a0397721b77
diff --git a/android/fdroid2fastlane.py b/android/fdroid2fastlane.py
index a39f494c..2726e3ba 100755
--- a/android/fdroid2fastlane.py
+++ b/android/fdroid2fastlane.py
@@ -7,10 +7,11 @@ Usage:
--summary 'Edit audio file metadata' \
--icon kid3/src/app/128-apps-kid3.png \
--screenshot https://kid3.kde.org/images/ss_android_app.png \
- --fastlanezip fastlane.zip
+ --fastlanezip fastlane-org.kde.kid3.zip
"""
import argparse
+import re
import shutil
import urllib.request
import zipfile
@@ -52,15 +53,22 @@ def extract_metadata(fdroid_yaml_path: str) -> dict[str, str]:
short = description
if len(short) > 80:
short = short[:77] + "..."
+ summary_yml = ""
+ with open(fdroid_yaml_path, "r", encoding="utf-8") as f:
+ for line in f:
+ if not line.strip():
+ break
+ summary_yml += line
return {
"title": data.get("AutoName", ""),
"short_description": short,
"full_description": description,
+ "summary_yml": summary_yml,
}
def create_fastlane_structure(
- metadata: dict[str, str], summary="", icon_path="", screenshot_path=""
+ metadata: dict[str, str], app_id: str, summary="", icon_path="", screenshot_path=""
) -> TemporaryDirectory[str]:
"""
Create the fastlane directory structure in a temporary directory.
@@ -68,7 +76,10 @@ def create_fastlane_structure(
"""
temp_dir = TemporaryDirectory()
root_path = Path(temp_dir.name)
- metadata_dir = root_path / "metadata" / "android" / "en-US"
+ if metadata["summary_yml"]:
+ yml_file = root_path / f"{app_id}.yml"
+ yml_file.write_text(metadata["summary_yml"], encoding="utf-8")
+ metadata_dir = root_path / app_id / "en-US"
metadata_dir.mkdir(parents=True, exist_ok=True)
title_file = metadata_dir / "title.txt"
title_file.write_text(metadata["title"], encoding="utf-8")
@@ -78,7 +89,7 @@ def create_fastlane_structure(
)
full_desc_file = metadata_dir / "full_description.txt"
full_desc_file.write_text(metadata["full_description"], encoding="utf-8")
- images_dir = root_path / "metadata" / "android" / "images"
+ images_dir = metadata_dir / "images"
images_dir.mkdir(parents=True, exist_ok=True)
if icon_path and Path(icon_path).exists():
shutil.copy2(icon_path, images_dir / "icon.png")
@@ -88,7 +99,8 @@ def create_fastlane_structure(
if screenshot_path.startswith("http"):
try:
urllib.request.urlretrieve(
- screenshot_path, screenshots_dir / "shot.png"
+ screenshot_path,
+ screenshots_dir / f"1-{metadata['title'].lower()}.png",
)
except urllib.request.HTTPError:
print(f"Could not download {screenshot_path}")
@@ -126,8 +138,11 @@ def main():
)
args = parser.parse_args()
metadata = extract_metadata(args.fdroidyaml)
+ m = re.match(r"^.*fastlane-([^/]+).zip$", args.fastlanezip)
+ app_id = m.group(1) if m else "metadata/android"
temp_dir = create_fastlane_structure(
metadata,
+ app_id,
summary=args.summary,
icon_path=args.icon,
screenshot_path=args.screenshot,