fix(install): stamp each APK build with a rising build number

This commit is contained in:
2026-10-23 22:07:49 +01:00
parent 0b8763078c
commit 00d8714411
2 changed files with 70 additions and 2 deletions
+10 -2
View File
@@ -129,8 +129,16 @@ def build(kind, runner=subprocess.run, app=APP, cache=None, arguments=(), log=pr
"-v", "pipelines-flutter-gradle:/home/builder/.gradle",
"-v", "pipelines-android-sdk:/opt/android-sdk",
"-v", f"{signing_dir()}:/home/builder/.android"]
docker(runner, *command, tag, "pipelines-app-build", kind, *arguments)
(work / ".complete").write_text(json.dumps({"key": key, "built": int(time.time())}) + "\n")
built = int(time.time())
stamp = ()
if kind == "apk":
# Android installs only a higher build number over the last one, so
# each build is stamped when it is made (minutes since the epoch);
# the stamp is not part of the reuse key.
code = built // 60
stamp = (f"--build-number={code}", f"--build-name=0.1.{code}")
docker(runner, *command, tag, "pipelines-app-build", kind, *arguments, *stamp)
(work / ".complete").write_text(json.dumps({"key": key, "built": built}) + "\n")
if entry.exists():
shutil.rmtree(entry)
work.rename(entry)