Skip to content

czdev 发布流程优化 + cardputerzero.github.io 在线提交方案(issue-ops)#10

Draft
eggfly wants to merge 4 commits into
mainfrom
cursor/online-submission-czdev-improvements-2efb
Draft

czdev 发布流程优化 + cardputerzero.github.io 在线提交方案(issue-ops)#10
eggfly wants to merge 4 commits into
mainfrom
cursor/online-submission-czdev-improvements-2efb

Conversation

@eggfly

@eggfly eggfly commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

背景

回应「czdev 提交 deb 目前是 GitHub 登录的本地操作,能否让 cardputerzero.github.io 支持在线提交」以及 czdev / 开发者上传 Store 的相关优化。

czdev CLI 优化(本 PR 直接落地)

  • 符合 dpkg 规范的版本比较scripts/czdev/debver.py):原来 bump.py / publish.py 里各有一份只看数字的简易比较,1.0~beta1.0-m5stack1、epoch 等都会判错,与 packages 仓库 CI 用的 dpkg --compare-versions 结论不一致。新实现移植 dpkg 的 verrevcmp 算法,已用 3570 组版本对与真实 dpkg --compare-versions 交叉验证,0 差异。
  • 去掉 SSH key 依赖czdev publish 原来用 git@github.com: 推送,用户即使 czdev login 过了还得配 SSH key 才能发布。现在改用 HTTPS + OAuth token 推送,czdev login 一次即可发布;git 报错输出会脱敏 token。
  • fork 就绪等待 + 同步:GitHub fork 是异步的,首次发布经常在 fork 尚未就绪时 fetch 失败;老 fork 的 main 落后也会导致基于旧基线提 PR。现在 fork 后轮询等待就绪,并通过 merge-upstream 先快进 main(publish 和 unpublish 都覆盖)。
  • 临时仓库内配置 git 身份:没有全局 git config 的机器上 git commit 不再失败,且提交人邮箱与审核用的 noreply 邮箱一致。
  • 补上 ./czdev 启动器:README 一直写 ./czdev login/publish,但仓库根本没有这个文件;新增 bash 包装脚本,仅需 Python 3。
  • README 清理:移除已废弃的 git-lfs 要求,修正流程图里的 LFS 描述。

已验证:全部模块编译通过;./czdev bump --deb(假 deb + 线上索引)端到端跑通,正确查到 nc2000 线上 1.0.3 并建议 1.0.4。

在线提交方案(设计文档 docs/ONLINE_SUBMISSION.md

结论:纯静态 Pages 无法直接在浏览器里复刻 czdev 流程——uploads.github.com(Release 资产上传)和 OAuth 令牌交换端点都没有 CORS(已实测)。推荐零后端的 issue-ops 方案

  1. 开发者把 .deb 挂到自己仓库的 Release(GitHub 网页即可操作);
  2. cardputerzero.github.io 的提交页表单生成预填的 Issue 链接,跳转 CardputerZero/packages 开 Issue(登录由 GitHub 原生处理);
  3. packages 上的 Action 监听 package-submission Issue:下载校验 .deb(与 validate-pr 同一套规则 + Issue 作者身份比对)、克隆源码仓库读取 app-builder.json store 元数据与截图、自动开发布 PR 并在 Issue 下回帖结果;
  4. 管理员照常审核合并,走现有 apt-pool 提升与索引重建管线。

文档里附了可直接套用的 Issue 表单、处理 workflow、网页代码片段,与 czdev CLI 通道产物格式完全一致、并存不冲突。

⚠️ 需要的权限

当前 agent 只有 m5stack/CardputerZero-AppBuilder 的写权限,对以下两个仓库推送均被拒(已实测):

  • CardputerZero/packages(放 Issue 表单 + 提交处理 workflow)
  • CardputerZero/cardputerzero.github.io(加在线提交页面)

请在 GitHub 上 CardputerZero 组织 → Settings → GitHub Apps → Cursor → Repository access 中加入这两个仓库,之后即可继续落地在线提交的两侧改动。

Open in Web Open in Cursor 

cursoragent and others added 4 commits July 13, 2026 17:30
Replace the naive numeric-only compare_versions duplicated in bump.py and
publish.py with a shared debver module implementing the dpkg verrevcmp
algorithm (epoch, tilde pre-releases, alphanumeric revisions). Cross-checked
against dpkg --compare-versions on 3570 version pairs with zero mismatches,
so czdev now agrees with apt/dpkg and the packages-repo CI.

Co-authored-by: eggfly <lihaohua90@gmail.com>
- Push metadata over HTTPS using the OAuth token from 'czdev login' instead
  of git@github.com, so publishing no longer requires an SSH key.
- Wait for the asynchronous fork to become ready and fast-forward its main
  via merge-upstream before branching, fixing failures on first-time and
  stale forks (publish and unpublish).
- Configure a local git identity in the temp clone so committing works
  without global git config, matching the maintainer-email review check.
- Redact the OAuth token from git error output.

Co-authored-by: eggfly <lihaohua90@gmail.com>
README documents ./czdev login/publish/bump/unpublish, but the launcher was
missing; add a thin bash wrapper that runs the Python package in scripts/
with only a Python 3 dependency.

Co-authored-by: eggfly <lihaohua90@gmail.com>
The LFS-based publish flow was replaced by release manifests; update the
README requirements and flow diagram accordingly. Add docs/ONLINE_SUBMISSION.md
describing a zero-backend issue-ops flow for submitting packages from
cardputerzero.github.io, with ready-to-apply issue form, workflow, and web
snippets for the packages and site repositories.

Co-authored-by: eggfly <lihaohua90@gmail.com>
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.

2 participants