fix(fnos): reuse content-addressed core runtime

This commit is contained in:
2026-08-12 17:33:05 +08:00
parent eec1227179
commit 1babec1b85
5 changed files with 63 additions and 12 deletions
+2 -1
View File
@@ -50,6 +50,7 @@ PYTHON_BIN=$(command -v "$PYTHON_BIN") || {
printf 'Python with hatchling is required to assemble the release.\n' >&2
exit 1
}
APP_VERSION=$("$PYTHON_BIN" -c 'import pathlib,sys,tomllib; print(tomllib.loads(pathlib.Path(sys.argv[1]).read_text())["project"]["version"])' "$PROJECT_ROOT/pyproject.toml")
command -v npm >/dev/null 2>&1 || { printf 'npm is required.\n' >&2; exit 1; }
"$PYTHON_BIN" -c 'import hatchling' >/dev/null 2>&1 || {
printf 'hatchling is required in the release Python environment.\n' >&2
@@ -89,7 +90,7 @@ done
PACKAGE_ID=$("$PYTHON_BIN" -c \
'import hashlib,sys; h=hashlib.sha256(); [h.update(open(path,"rb").read()) for path in sys.argv[1:]]; print(h.hexdigest())' \
"$STAGED_APP_WHEEL" "$STAGE/app/runtime/runtime-core.txt")
printf '%s\n%s\n' "$PACKAGE_VERSION" "$PACKAGE_ID" >"$STAGE/app/runtime/VERSION"
printf '%s\n%s\n%s\n' "$PACKAGE_VERSION" "$APP_VERSION" "$PACKAGE_ID" >"$STAGE/app/runtime/VERSION"
"$PYTHON_BIN" "$PROJECT_ROOT/scripts/make_icons.py" "$STAGE"
chmod 0755 "$STAGE/cmd/"*
(