Release 0.2.3+6

This commit is contained in:
Claude 2026-08-30 18:09:54 +02:00
parent 78f5a44e90
commit 30b4a8238b
5 changed files with 54 additions and 10 deletions

View file

@ -13,6 +13,11 @@ in the device keystore and never leaves it.
./release.py ../amber-adult/build/app/outputs/flutter-apk/app-release.apk "what changed"
```
Add `--linux ../amber-adult/build/linux/x64/release/bundle` to publish the
desktop build with it. Off by default: it is another ~34MB per release, and the
desktop has no self-updater to feed — it exists so a source can be checked
without walking to the television.
It reads the version and build number out of `amber-adult/pubspec.yaml`, copies
the APK in under a versioned name, writes `manifest.json`, and commits. Push,
and Coolify redeploys.
@ -24,10 +29,24 @@ 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-<build>.apk` name, which
is what lets a device that is midway through a download survive a release.
| | |
|---|---|
| Android | `https://media-updates.petruzalekr.cz/latest.apk` |
| Linux x64 | `https://media-updates.petruzalekr.cz/latest-linux.tar.gz` |
Both are symlinks the release script repoints, so the addresses never change.
Every past build stays reachable under its own `media-<build>.apk` /
`media-linux-<build>.tar.gz` name, which is what lets a device midway through a
download survive a release.
The Linux tarball unpacks to `amber-adult/`; run `./amber-adult/amber_adult`.
**It needs libmpv on the system** — media_kit loads it at runtime rather than
bundling it, so on Arch that is the `mpv` package and on Debian
`libmpv2`. Nothing warns about its absence up front; the app starts and
playback fails.
Only Android updates itself. The desktop build is replaced by downloading a
newer tarball.
## The manifest

1
public/latest-linux.tar.gz Symbolic link
View file

@ -0,0 +1 @@
media-linux-6.tar.gz

View file

@ -1,7 +1,7 @@
{
"version": "0.2.3",
"buildNumber": 6,
"notes": "Adresa zkopírovaná z konfigurační stránky doplňku (končící na /manifest.json) i odkaz stremio:// teď fungují — dosud vracely 404.",
"notes": "Linuxový build ke stažení. Bez změny v appce oproti 0.2.3.",
"sha256": "18e568f2dbd0c18f3b39a4b188d705acc5a1c86e221291e45611cd685d0d33a8",
"size": 34427585,
"url": "https://media-updates.petruzalekr.cz/media-6.apk"

BIN
public/media-linux-6.tar.gz Normal file

Binary file not shown.

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Publish an APK: copy it in, write the manifest, commit.
"""Publish a release: copy the artifacts in, write the manifest, commit.
Reads the version and build number out of amber-adult's pubspec so the two
cannot drift a manifest advertising a build number the APK does not carry is
@ -12,6 +12,7 @@ import re
import shutil
import subprocess
import sys
import tarfile
HERE = pathlib.Path(__file__).resolve().parent
PUBSPEC = HERE.parent / "amber-adult" / "pubspec.yaml"
@ -27,12 +28,24 @@ def pubspec_version() -> tuple[str, int]:
def main() -> None:
if len(sys.argv) < 2:
sys.exit("usage: release.py <apk> [notes]")
apk = pathlib.Path(sys.argv[1]).resolve()
notes = sys.argv[2] if len(sys.argv) > 2 else ""
args = sys.argv[1:]
# Linux is optional and off by default. It is another ~34MB in the
# repository per release, and the desktop build has no self-updater to feed
# — it exists so somebody can check a source without walking to the
# television, and is published when that is worth doing.
linux_bundle = None
if "--linux" in args:
i = args.index("--linux")
linux_bundle = pathlib.Path(args[i + 1]).resolve()
del args[i:i + 2]
if not args:
sys.exit("usage: release.py <apk> [notes] [--linux <bundle-dir>]")
apk = pathlib.Path(args[0]).resolve()
notes = args[1] if len(args) > 1 else ""
if not apk.is_file():
sys.exit(f"no such APK: {apk}")
if linux_bundle is not None and not linux_bundle.is_dir():
sys.exit(f"no such bundle directory: {linux_bundle}")
version, build = pubspec_version()
public = HERE / "public"
@ -64,6 +77,17 @@ def main() -> None:
latest.unlink(missing_ok=True)
latest.symlink_to(name)
if linux_bundle is not None:
tar_name = f"media-linux-{build}.tar.gz"
# Renamed on the way in, so unpacking gives a directory somebody can
# read rather than "bundle".
with tarfile.open(public / tar_name, "w:gz") as tar:
tar.add(linux_bundle, arcname="amber-adult")
tar_latest = public / "latest-linux.tar.gz"
tar_latest.unlink(missing_ok=True)
tar_latest.symlink_to(tar_name)
print(f"staged {tar_name}")
subprocess.run(["git", "add", "-A"], cwd=HERE, check=True)
subprocess.run(
["git", "commit", "-m", f"Release {version}+{build}"],