Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Sep 15, 2024
1 parent d208829 commit 53feed4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build_helper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main() -> None:
args = parser.parse_args()
if args.config:
import json
config = json.loads(args.config)
config = json.loads(bytes.fromhex(args.config).decode("utf-8"))
match args.task:
case "prepare":
from .prepare import get_matrix, parse_configs, prepare
Expand Down
5 changes: 3 additions & 2 deletions build_helper/build.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 沉默の金 <cmzj@cmzj.org>
# SPDX-License-Identifier: MIT
import os
import re
import shutil
import tarfile
import tempfile
import zipfile
import re

from actions_toolkit import core
from actions_toolkit.github import Context

Expand Down Expand Up @@ -183,4 +184,4 @@ def build_image_builder(cfg: dict) -> None:
uploader.add(f"Image_Builder-{cfg['name']}", bl_path, retention_days=1, compression_level=0)

logger.info("删除旧缓存...")
del_cache(get_cache_restore_key(openwrt, cfg))
del_cache(get_cache_restore_key(openwrt, cfg))
4 changes: 2 additions & 2 deletions build_helper/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_matrix(configs: dict[str, dict]) -> str:
matrix = {"include": []}
for name, config in configs.items():
config["name"] = name
matrix["include"].append({"name": name, "config": json.dumps(config, separators=(',', ':'))})
matrix["include"].append({"name": name, "config": gzip.compress(json.dumps(config, separators=(',', ':')).encode("utf-8")).hex().upper()})
return json.dumps(matrix)


Expand Down Expand Up @@ -216,7 +216,7 @@ def prepare_cfg(config: dict[str, Any],
openwrt: OpenWrt,
cloned_repos: dict[tuple[str, str], str],
global_files_path: str,
compiler: str):
compiler: str) -> tuple[str, dict[str, Any], str]:
logger.info("%s处理软件包...", cfg_name)
for pkg_name, pkg in config["extpackages"].items():
path = os.path.join(openwrt.path, "package", "cmzj_packages", pkg_name)
Expand Down

0 comments on commit 53feed4

Please sign in to comment.