Bind releases to licensing build signatures

This commit is contained in:
faumaray committed 2026-08-02 01:50:40 +03:00
1 parent 9e6e6ca97b
commit 5d06619d66
7 files changed
+96 -15

No files matched your search

+21 -2
View File
@@ -108,7 +108,11 @@ def collect_entries(root: Path) -> list[dict[str, object]]:
def write_manifest(
root: Path, version: str, build_type: str, output: Path
root: Path,
version: str,
build_type: str,
build_signature: str,
output: Path,
) -> None:
entries = collect_entries(root)
regular_files = {
@@ -144,6 +148,7 @@ def write_manifest(
"schemaVersion": 2,
"version": version,
"buildType": build_type,
"buildSignature": build_signature,
"executable": executable,
"updater": updater,
"core": core,
@@ -176,6 +181,7 @@ def main() -> int:
choices=("RelWithDebInfo",),
default="RelWithDebInfo",
)
parser.add_argument("--build-signature")
parser.add_argument("--output", type=Path)
arguments = parser.parse_args()
@@ -183,7 +189,20 @@ def main() -> int:
parser.error("version must contain only letters, digits, dot, underscore, or dash")
root = arguments.root.resolve(strict=True)
output = arguments.output or root / "manifest.json"
write_manifest(root, arguments.version, arguments.build_type, output)
build_signature = arguments.build_signature or f"development:{arguments.version}"
if (
not build_signature
or len(build_signature) > 256
or any(character in build_signature for character in "\r\n\0")
):
parser.error("build signature must be 1-256 characters without controls")
write_manifest(
root,
arguments.version,
arguments.build_type,
build_signature,
output,
)
return 0