feat(firmware-info): копируй папку текущей сборки целиком

Добавь каталог назначения последним аргументом postcompile CCS и Keil. Копируй только архив текущего запуска с сохранением имени папки, всех файлов и проверкой SHA-256. Обнови MD-команды и проверки выбора папки, вложенных файлов и ошибок экспорта.
This commit is contained in:
2026-10-08 16:26:21 +03:00
parent da055c2787
commit 4fc0ad4e14
6 changed files with 94 additions and 23 deletions
+3 -2
View File
@@ -16,7 +16,7 @@ from identity import archive_build, seal, verify
def postbuild(compiler: Path, build_dir: Path, artifact: str,
metadata: Path, output: Path) -> Path:
metadata: Path, output: Path, export: Path = None) -> Path:
if not artifact or artifact in (".", "..") or any(c in artifact for c in '\\/:*?"<>|'):
raise ValueError("artifact must be a file base name, without a path")
tool = compiler.resolve() / "bin" / "hex2000.exe"
@@ -53,7 +53,7 @@ def postbuild(compiler: Path, build_dir: Path, artifact: str,
archive_build(result, metadata, output, (
output / hex_image.name,
output / (hex_image.name + ".map"),
output / (bin_image.name + ".map")))
output / (bin_image.name + ".map")), export=export)
print(f"[firmware-build] BIN: {result}")
print(f"[firmware-build] Manifest: {result}.manifest.json")
print(f"[firmware-build] SHA-256: {result}.sha256")
@@ -65,6 +65,7 @@ def main() -> int:
for name in ("compiler", "build-dir", "metadata", "output"):
parser.add_argument("--" + name, type=Path, required=True)
parser.add_argument("--artifact", required=True)
parser.add_argument("--export", type=Path)
try:
postbuild(**vars(parser.parse_args()))
except (OSError, ValueError, KeyError, TypeError, subprocess.CalledProcessError) as error: