Skip to content

feat: CN 资源镜像 (mcpp-res) + GLOBAL/CN url 表#41

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/cn-mirror
Jun 8, 2026
Merged

feat: CN 资源镜像 (mcpp-res) + GLOBAL/CN url 表#41
Sunrisepeak merged 1 commit into
mainfrom
feat/cn-mirror

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

概述

为 mcpp-index 的所有包资源增加 CN 镜像机制:在 gitcode 上建立 mcpp-res 组织,为每个库创建对应仓库并把资源以 release 资产形式上传,然后把每个包描述的下载 url 从普通字符串改为 { GLOBAL=..., CN=... } 镜像表(遵循 xpkg V1 规范,解析优先级 GLOBAL > CN)。

  • GLOBAL = 当前上游地址,默认行为完全不变。
  • CN = gitcode 国内镜像,内容与 GLOBAL 逐字节一致(同一 sha256)。
  • 切换:mcpp self config --mirror CN(透传给 xlings 安装引擎)。

镜像规模

  • 50 个资源,跨 35mcpp-res 仓库,逐个发布为 release 资产:
    https://gitcode.com/mcpp-res/<库>/releases/download/<版本>/<库>-<版本>.<ext>
  • 37 个描述文件改写(120 处 url 字段)。

CI 更新

  • validate / lint:新增 tests/check_mirror_urls.lua —— 校验镜像表必须同时含 GLOBAL+CN,且 CN 指向 gitcode.com/mcpp-res/
  • validate / mirror-cn-reachable:新增任务,用 tests/list_cn_urls.lua 提取所有 CN url 并探测每个资产可达。

闭环验证

下载全部 50 个 CN url 并与描述文件记录的 sha256 比对:50/50 通过(字节级一致)。本地 lint + check_mirror_urls.lua 全部通过。

兼容性

url 表是合法 Lua,旧版解析按 GLOBAL > CN 取 GLOBAL,行为与改动前一致;新增 CN 仅在 --mirror CN 时生效。

Mirror every package resource to the gitcode `mcpp-res` org and switch
each descriptor's download `url` to a `{ GLOBAL=..., CN=... }` table per
the xpkg V1 spec (resolution priority GLOBAL > CN, so default behavior is
unchanged). Select with `mcpp self config --mirror CN|GLOBAL`.

- 50 resources across 35 mcpp-res repos, each published as a release asset
  (https://gitcode.com/mcpp-res/<repo>/releases/download/<ver>/<file>),
  byte-identical to the upstream source (same sha256).
- 37 descriptors rewritten (120 url fields).
- validate CI: lint mirror tables (tests/check_mirror_urls.lua) + probe
  every CN asset is reachable (mirror-cn-reachable job, tests/list_cn_urls.lua).
- README: document the GLOBAL/CN mirror + mcpp-res org.
@Sunrisepeak Sunrisepeak merged commit c72a4f7 into main Jun 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant