开发者中心落地 dev-portal:Cloudflare Worker + GitHub Actions CI/CD 自动部署#1
Merged
Conversation
Sourced from m5stack/CardputerZero-AppBuilder PR #12 (dev-portal, which supersedes PR #11's online-submit worker): Cloudflare Worker serving the portal page and API on dev.cardputer.cc, browser-side .deb parsing, GitHub OAuth email ownership, and the packages-repo dispatch workflows. Co-authored-by: eggfly <lihaohua90@gmail.com>
Run parser tests, then wrangler deploy through cloudflare/wrangler-action (no Cloudflare git integration). Optionally sync Worker secrets from GitHub Actions secrets. Add docs/DEPLOY.md with the full setup guide, merging the deployment/security notes from AppBuilder PR #11 and #12. Co-authored-by: eggfly <lihaohua90@gmail.com>
eggfly
marked this pull request as ready for review
July 14, 2026 16:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
把 AppBuilder PR #11 和 PR #12 落地到本仓库,并按要求改为 GitHub Actions CI/CD 部署(push
main自动wrangler deploy到 Cloudflare Workers,不用 Cloudflare 的 git 集成自动拉取)。两个 PR 怎么合的
PR #12(
dev-portal/目录)是 PR #11(online-submit/)的演进版,功能是其超集(同域托管免 CORS、浏览器本地解析 .deb、抢占式包名归属、下架、管理员),所以:worker/(Cloudflare Worker,页面 + API 同域)、site/(本地解析 + 上传/管理页)、packages-workflows/(复制到CardputerZero/packages的两个 workflow)、test/docs/DEPLOY.md(Cloudflare 域名接入、OAuth App、bot token、OSS 直传取舍分析)api.cardputer.cc+ 跨域 CORS 方案)和submit.html已被 fix(worker): 修复提交 422(client_payload 超过 10 个顶层属性) #12 的同域方案取代,不再保留CI/CD(
.github/workflows/deploy.yml)main→ 跑 deb 解析器单元测试 →cloudflare/wrangler-action部署 Worker(含静态站点)workflow_dispatchOAUTH_CLIENT_ID/OAUTH_CLIENT_SECRET/BOT_TOKEN/SESSION_SECRET,每次部署自动同步到 Worker secrets,无需本地wrangler secret put域名
cardputer.cczone 已在 Cloudflare(NS 已切到 eva/nick.ns.cloudflare.com),主域继续指向 GitHub Pages 商店站不受影响;开发者中心用dev.cardputer.cc,wrangler.toml已声明 custom domain,首次部署自动接管 DNS + 证书。合并后需要人工做的(详见 docs/DEPLOY.md)
CLOUDFLARE_API_TOKEN(Workers Scripts: Edit + Workers Custom Domains: Edit + zone DNS: Edit)和CLOUDFLARE_ACCOUNT_IDhttps://dev.cardputer.cc/auth/callback),配 bot PAT(CardputerZero/packagesContents: RW),四个密钥配到 GitHub secrets(或本地wrangler secret put一次)packages-workflows/两个文件复制进CardputerZero/packages的.github/workflows/,建web-submission-failedlabel已验证
node --test:4 个解析器用例全过(含 gzip/xz/zstd、恶意包 flag、dpkg 版本语义)wrangler deploy --dry-run:Worker + 3 个静态资源打包正常,绑定齐全