diff --git a/.github/workflows/build-openwrt-py.yml b/.github/workflows/build-openwrt-py.yml index bb970cd4..0c34daef 100644 --- a/.github/workflows/build-openwrt-py.yml +++ b/.github/workflows/build-openwrt-py.yml @@ -38,14 +38,14 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 准备 id: run run: python3 -m build_helper --task prepare - name: 上传 - uses: /opt/OpenWrt-K/.github/action/upload + uses: ./../../../../../opt/OpenWrt-K/.github/action/upload base-builds: runs-on: ubuntu-22.04 @@ -59,7 +59,7 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 准备编译 id: prepare @@ -92,7 +92,7 @@ jobs: - name: 上传 if: success() || failure() - uses: /opt/OpenWrt-K/.github/action/upload + uses: ./../../../../../opt/OpenWrt-K/.github/action/upload build-packages: runs-on: ubuntu-22.04 @@ -106,7 +106,7 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 准备编译 id: prepare @@ -127,7 +127,7 @@ jobs: - name: 上传 if: success() || failure() - uses: /opt/OpenWrt-K/.github/action/upload + uses: ./../../../../../opt/OpenWrt-K/.github/action/upload build-ImageBuilder: runs-on: ubuntu-22.04 @@ -141,7 +141,7 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 准备编译 id: prepare @@ -162,7 +162,7 @@ jobs: - name: 上传 if: success() || failure() - uses: /opt/OpenWrt-K/.github/action/upload + uses: ./../../../../../opt/OpenWrt-K/.github/action/upload build-images: runs-on: ubuntu-22.04 @@ -176,7 +176,7 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 准备构建 id: prepare @@ -188,7 +188,7 @@ jobs: - name: 上传 if: success() || failure() - uses: /opt/OpenWrt-K/.github/action/upload + uses: ./../../../../../opt/OpenWrt-K/.github/action/upload releases: runs-on: ubuntu-22.04 @@ -201,7 +201,7 @@ jobs: with: path: /opt/OpenWrt-K - name: 建立环境 - uses: /opt/OpenWrt-K/.github/action/prepare + uses: ./../../../../../opt/OpenWrt-K/.github/action/prepare - name: 发布 run: python3 -m build_helper --task releases --config ${{ matrix.config }} \ No newline at end of file diff --git a/build_helper/build.py b/build_helper/build.py index 5652d66f..352ae728 100644 --- a/build_helper/build.py +++ b/build_helper/build.py @@ -163,16 +163,13 @@ def build_image_builder(cfg: dict) -> None: config = f.read() with open(os.path.join(openwrt.path, ".config"), "w") as f: for line in config.splitlines(): - if match := re.match(r"CONFIG_(?P.+)_IMAGES=y", line): - f.write(f"CONFIG_{match.group('name')}_IMAGE=n\n") + if match := re.match(r"CONFIG_(?P[^_=]+)_IMAGES=y", line) or (match := re.match(r"CONFIG_TARGET_ROOTFS_(?P[^_=]+)=y", line)): + name = match.group("name") + if name in ("ISO", "VMDK", "TARGZ", "CPIOGZ", "EXT4FS", "SQUASHF", "GZIP"): + logger.debug(f"不构建 {name} 格式镜像") + f.write(line.replace("=y", "=n") + "\n") else: - match line: - case "CONFIG_TARGET_ROOTFS_TARGZ=y": - f.write("CONFIG_TARGET_ROOTFS_TARGZ=n\n") - case "CONFIG_TARGET_ROOTFS_CPIOGZ=y": - f.write("CONFIG_TARGET_ROOTFS_CPIOGZ=n\n") - case _: - f.write(line + "\n") + f.write(line + "\n") openwrt.make_defconfig() logger.info("下载编译所需源码...") diff --git a/build_helper/utils/repo.py b/build_helper/utils/repo.py index 8b621b1a..9e8c222d 100644 --- a/build_helper/utils/repo.py +++ b/build_helper/utils/repo.py @@ -29,7 +29,7 @@ def dl_artifact(name: str, path: str) -> str: for artifact in repo.get_artifacts(): if artifact.workflow_run.id == context.run_id and artifact.name == name: dl_url = artifact.archive_download_url - logger.info(f'Downloading artifact {name} from {dl_url}') + logger.debug(f'Downloading artifact {name} from {dl_url}') break else: msg = f'Artifact {name} not found'