diff --git a/README.md b/README.md index b5006dc..41305f0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,13 @@ the cheaper trade against standing up artifact storage for one app; if the repository ever gets uncomfortable, the history is disposable — only the newest artifact is ever fetched. +## Downloading by hand + +`https://media-updates.petruzalekr.cz/latest.apk` always points at the newest +build — a symlink the release script repoints, so the address never changes. +Every past build stays reachable under its own `media-.apk` name, which +is what lets a device that is midway through a download survive a release. + ## The manifest ```json diff --git a/public/latest.apk b/public/latest.apk new file mode 120000 index 0000000..6646af6 --- /dev/null +++ b/public/latest.apk @@ -0,0 +1 @@ +media-6.apk \ No newline at end of file diff --git a/release.py b/release.py index 94e2efb..d51eb98 100755 --- a/release.py +++ b/release.py @@ -56,6 +56,14 @@ def main() -> None: json.dumps(manifest, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + # A stable name, so "where do I download it" has one permanent answer + # instead of one that has to be looked up in the manifest each time. A + # symlink rather than a copy: git stores it as a path, so it costs bytes + # rather than another 34MB per release. + latest = public / "latest.apk" + latest.unlink(missing_ok=True) + latest.symlink_to(name) + subprocess.run(["git", "add", "-A"], cwd=HERE, check=True) subprocess.run( ["git", "commit", "-m", f"Release {version}+{build}"],