create-dwy 0.14.7 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/bin/index.js +4 -0
- package/package.json +1 -1
- package/src/skills-install.js +113 -0
- package/src/sync-all.js +19 -0
- package/templates/ai-tools/CLAUDE.md +1 -1
- package/templates/ai-tools/hooks/Git/pre-git-commit-sensitive-check.sh +10 -2
- package/templates/ai-tools/rules/HarmonyOS/dwy-arkts-strict.md +221 -0
- package/templates/ai-tools/rules/HarmonyOS/dwy-arkts-ui-build.md +193 -0
- package/templates/ai-tools/rules/iOS/dwy-ios-pitfalls.md +159 -0
- package/templates/ai-tools/rules/iOS/dwy-swift-core.md +35 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-acceptance/SKILL.md +23 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-architecture/SKILL.md +28 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-competitor/SKILL.md +22 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-ideate/SKILL.md +21 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-mvp/SKILL.md +23 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-poc/SKILL.md +24 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-prd/SKILL.md +22 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-product-launcher/SKILL.md +68 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-product-launcher/references/state-and-contract.md +103 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-prototype/SKILL.md +23 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-release/SKILL.md +26 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-design/SKILL.md +23 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-dev/SKILL.md +22 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-launch/SKILL.md +25 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-prd/SKILL.md +22 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-ship/SKILL.md +21 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-tasks/SKILL.md +22 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-tdd-dev/SKILL.md +25 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-validate/SKILL.md +28 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-version/SKILL.md +23 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish/SKILL.md +365 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish/references/electron-release-workflow-template.yml +98 -0
- package/templates/ai-tools/skills//{350/277/220/347/273/264/345/217/221/345/270/203/dwy-cibuildwheel → 345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish}/references/release-workflow-template.yml +3 -3
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/SKILL.md +31 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/android.md +31 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/backend-deploy.md +23 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/changelog.md +37 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/frontend-deploy.md +23 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/generic-release.md +27 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/harmony.md +25 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/ios.md +32 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/monitor-notify.md +36 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/publish-config.md +65 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/version-sync.md +30 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/scripts/release_config.sh +115 -0
- package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/SKILL.md +31 -21
- package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/references/python-commercial-guide.md +1 -1
- package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/references/sensitive-patterns.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-sdk-spec/scripts/init_config.sh +91 -0
- package/templates/ai-tools/skills//345/274/200/345/217/221/346/265/201/347/250/213/dwy-whiteboard-prototype/SKILL.md +70 -0
- package/templates/ai-tools/skills//345/274/200/345/217/221/346/265/201/347/250/213/dwy-whiteboard-prototype/assets/template.html +353 -0
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-sdk-spec/scripts/init_config.sh +0 -97
- package/templates/ai-tools/skills//345/274/200/345/217/221/346/265/201/347/250/213/dwy-publish/SKILL.md +0 -50
- package/templates/ai-tools/skills//345/274/200/345/217/221/346/265/201/347/250/213/dwy-publish/references/application-release.md +0 -106
- package/templates/ai-tools/skills//345/274/200/345/217/221/346/265/201/347/250/213/dwy-publish/references/sdk-release.md +0 -93
- package/templates/ai-tools/skills//350/277/220/347/273/264/345/217/221/345/270/203/dwy-cibuildwheel/SKILL.md +0 -356
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/assets/files-whitelist-snippet.json" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/assets/js-commercial.npmignore" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/assets/python-commercial-MANIFEST.in" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/assets/python-commercial.gitignore" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/references/js-commercial-guide.md" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/references/publish-blacklist.md" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/scripts/check_comments.py" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/scripts/check_js_publish.sh" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/scripts/check_python_publish.sh" +0 -0
- /package/templates/ai-tools/skills//345/{256/211/345/205/250 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-sdk-spec/scripts/detect_sdk.sh" +0 -0
- /package/templates/ai-tools/skills//345/{274/200/345/217/221/346/265/201/347/250/213 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-semver/SKILL.md" +0 -0
- /package/templates/ai-tools/skills//345/{274/200/345/217/221/346/265/201/347/250/213 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-semver/references/semver-spec.md" +0 -0
- /package/templates/ai-tools/skills//345/{274/200/345/217/221/346/265/201/347/250/213 → 217/221/345/270/203/345/217/221/347/211/210}/dwy-semver/scripts/bump.py" +0 -0
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-design/SKILL.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-stage-design
|
|
3
|
+
description: "【dwy·设计架构阶段】产品 0 到 1 的第三阶段编排。触发场景:用户说『画原型 + 定架构 / 做设计 / 出原型出架构 / 需求定了开始设计 / 设计和技术架构一起搞』,要把 PRD 同时展开成交互原型和技术架构时。可独立触发——需求已定,只想做设计架构,就触发我。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一·编排层)
|
|
7
|
+
并行调度设计架构阶段的两条原子线,不掺产出内容。设计线与架构线互不依赖,**两线并行**。
|
|
8
|
+
|
|
9
|
+
## 前置校验(开工前读 state)
|
|
10
|
+
- 读 `.dwy/prod/[项目]/state.json`
|
|
11
|
+
- 校验上游完整:`confirmed.prd` + `confirmed.version_plan` 必须存在
|
|
12
|
+
- 缺失 → 报错中断,提示先跑 dwy-stage-prd
|
|
13
|
+
|
|
14
|
+
## 编排(并行两线)
|
|
15
|
+
两条线无依赖,**用子 Agent 并发执行**(各自独立上下文):
|
|
16
|
+
- **dwy-prototype** — 交互原型设计
|
|
17
|
+
- **dwy-architecture** — 技术架构设计
|
|
18
|
+
|
|
19
|
+
两个子 Agent 只向主窗口返回成果摘要,产出落各自文件。
|
|
20
|
+
|
|
21
|
+
## 准出条件(硬约束)
|
|
22
|
+
- 设计与架构**均确认**:`confirmed.prototype` + `confirmed.architecture` 均写入
|
|
23
|
+
- 回写 `state.json`:`current_stage = "dev"`
|
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-dev/SKILL.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-stage-dev
|
|
3
|
+
description: "【dwy·TDD开发阶段】产品 0 到 1 的第四阶段编排。触发场景:用户说『开始开发 / 按 TDD 写代码 / 把 V1.0 开发出来 / 设计定了开始编码 / 多模块并发开发』,要按模块循环用 TDD 把当前版本所有模块做完时。可独立触发——设计架构已定,只想做开发,就触发我。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一·编排层)
|
|
7
|
+
调度 TDD 开发原子 skill 按模块循环,不掺产出内容。版本内互不依赖的模块**多模块并发**。
|
|
8
|
+
|
|
9
|
+
## 前置校验(开工前读 state)
|
|
10
|
+
- 读 `.dwy/prod/[项目]/state.json`
|
|
11
|
+
- 校验上游完整:`confirmed.prototype` + `confirmed.architecture` + `confirmed.tasks` 必须存在
|
|
12
|
+
- 缺失 → 报错中断,提示先跑 dwy-stage-design
|
|
13
|
+
|
|
14
|
+
## 编排(按模块循环 + 并发)
|
|
15
|
+
- 按 `confirmed.tasks` 的模块清单逐个调 **dwy-tdd-dev**
|
|
16
|
+
- 互不依赖的模块用多个子 Agent 并发;改同一批文件时各自独立 worktree 防冲突
|
|
17
|
+
- 有依赖的模块按依赖顺序串行
|
|
18
|
+
|
|
19
|
+
## 准出条件(硬约束)
|
|
20
|
+
- 当前版本(V1.0)**全模块测试通过**
|
|
21
|
+
- `confirmed.dev_progress` 写入(记录已完成模块与测试状态)
|
|
22
|
+
- 回写 `state.json`:`current_stage = "ship"`
|
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-launch/SKILL.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-stage-launch
|
|
3
|
+
description: "【dwy·立项阶段】产品 0 到 1 的第一阶段编排。触发场景:用户说『走立项流程 / 做立项 / 只想先把立项做完 / 验证这个想法值不值得做 / 想法收敛+竞品+需求验证+POC+MVP 一条龙』,要把模糊想法跑过三道闸门确认值不值得立项时。可独立触发——只想做立项不进后续,就触发我。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一·编排层)
|
|
7
|
+
按序调度立项阶段的原子 skill,串起三道闸门,不掺产出内容。核心原则:**廉价验证在前、昂贵投入在后**。需求验证是总闸门,过不了不进任何后续重活。
|
|
8
|
+
|
|
9
|
+
## 前置校验(开工前读 state)
|
|
10
|
+
- 读 `.dwy/prod/[项目]/state.json`
|
|
11
|
+
- 立项是首阶段,无上游依赖;若 `state.json` 不存在则由本阶段初始化
|
|
12
|
+
|
|
13
|
+
## 编排顺序(带闸门)
|
|
14
|
+
1. **dwy-ideate** — 想法收敛
|
|
15
|
+
2. **dwy-competitor** — 竞品分析
|
|
16
|
+
3. **dwy-validate(闸 1·总闸门)** — 需求验证。**没人要即停整个流程**,不进任何后续
|
|
17
|
+
4. **dwy-poc(闸 2)** — 仅闸 1 过才做。技术可行性验证,**做不出即砍**
|
|
18
|
+
5. **dwy-mvp(闸 3)** — 仅闸 2 过才做。MVP 范围裁剪,**功能 ≤ 7 个**
|
|
19
|
+
|
|
20
|
+
每道闸门未过 → 立即中断本阶段,回写 state 标记停止原因,不静默跳过。
|
|
21
|
+
|
|
22
|
+
## 准出条件(硬约束)
|
|
23
|
+
- 三闸全过:`confirmed.validation` / `confirmed.poc` / `confirmed.mvp_features` 均写入
|
|
24
|
+
- 用户明确确认立项
|
|
25
|
+
- 回写 `state.json`:`current_stage = "prd"`(进入下一阶段需求版本)
|
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-prd/SKILL.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-stage-prd
|
|
3
|
+
description: "【dwy·需求版本阶段】产品 0 到 1 的第二阶段编排。触发场景:用户说『写 PRD / 出需求文档 / 做需求版本规划 / 拆版本拆任务 / 立项过了开始写需求』,要把已立项的 MVP 展开成 PRD、切版本、排开发顺序时。可独立触发——立项已在别处做完,只想做需求版本,就触发我。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一·编排层)
|
|
7
|
+
按序调度需求版本阶段的原子 skill,不掺产出内容。把立项结论展开成可开发的需求与版本切分。
|
|
8
|
+
|
|
9
|
+
## 前置校验(开工前读 state)
|
|
10
|
+
- 读 `.dwy/prod/[项目]/state.json`
|
|
11
|
+
- 校验上游完整:`confirmed.mvp_features` 必须存在(立项阶段三闸全过)
|
|
12
|
+
- 缺失 → 报错中断,提示先跑 dwy-stage-launch
|
|
13
|
+
|
|
14
|
+
## 编排顺序
|
|
15
|
+
1. **dwy-prd** — 写产品需求文档
|
|
16
|
+
2. **dwy-version** — 版本规划(V1.0 / V1.1 …路线图)
|
|
17
|
+
3. **dwy-tasks** — 任务拆分 + 开发顺序
|
|
18
|
+
|
|
19
|
+
## 准出条件(硬约束)
|
|
20
|
+
- 用户确认 PRD + V1.0 范围 + 开发顺序
|
|
21
|
+
- `confirmed.prd` / `confirmed.version_plan` / `confirmed.tasks` 均写入
|
|
22
|
+
- 回写 `state.json`:`current_stage = "design"`
|
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-stage-ship/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-stage-ship
|
|
3
|
+
description: "【dwy·上架迭代阶段】产品 0 到 1 的第五阶段编排。触发场景:用户说『验收上线 / 发版上架 / 开始迭代 / 代码写完了走验收发布 / 确定下个版本方向』,要把已开发完的版本走完验收+发布并定迭代方向时。可独立触发——开发已完成,只想做验收上线,就触发我。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一·编排层)
|
|
7
|
+
按序调度上架迭代阶段的原子 skill,不掺产出内容。验收把关 → 发布上线 → 收口迭代方向。
|
|
8
|
+
|
|
9
|
+
## 前置校验(开工前读 state)
|
|
10
|
+
- 读 `.dwy/prod/[项目]/state.json`
|
|
11
|
+
- 校验上游完整:`confirmed.dev_progress` 必须存在(当前版本全模块测试通过)
|
|
12
|
+
- 缺失 → 报错中断,提示先跑 dwy-stage-dev
|
|
13
|
+
|
|
14
|
+
## 编排顺序
|
|
15
|
+
1. **dwy-acceptance** — 验收(对照 PRD 与验收标准把关)
|
|
16
|
+
2. **dwy-release** — 发布上线
|
|
17
|
+
|
|
18
|
+
## 准出条件(硬约束)
|
|
19
|
+
- 上线完成 + 用户确认下一版迭代方向
|
|
20
|
+
- `confirmed.acceptance` / `confirmed.release` 均写入
|
|
21
|
+
- 回写 `state.json`:当前版本标记完成;若有下一版本,`current_stage` 复位到 `prd` 进入下一轮版本编排
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-tasks
|
|
3
|
+
description: "【dwy·任务拆解】产品 0 到 1 需求规划阶段。触发场景:用户说『拆任务 / 拆解开发任务 / 排开发计划 / 写实施计划 / tasks』,要把 V1.0 版本范围拆成可执行的开发任务清单时。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一)
|
|
7
|
+
把 V1.0 版本范围拆成可执行、可验证的开发任务清单。
|
|
8
|
+
|
|
9
|
+
## 输入(从哪读)
|
|
10
|
+
- state.json 的 `confirmed.version_plan`、`confirmed.prd`
|
|
11
|
+
- `.dwy/prod/[项目]/02-需求规划/版本路线图.md`、`PRD.md`
|
|
12
|
+
|
|
13
|
+
## 实现
|
|
14
|
+
[包装型] 用全局本地 skill(位于 `~/.dwy/skills/<外部skill名>/`):
|
|
15
|
+
读其 `SKILL.md`(及同目录 scripts/、配套 .md),按它的方式与用户交互/提问,产出按下方「产出契约」落地。
|
|
16
|
+
- 本 skill 依赖的外部 skill:`writing-plans`(对应 `~/.dwy/skills/writing-plans/`)
|
|
17
|
+
- 若 `~/.dwy/skills/writing-plans/` 不存在:提示用户先跑 `dwy skills install`(或 `dwy claude sync` 会自动装),不要自己用内置能力顶替。
|
|
18
|
+
|
|
19
|
+
## 产出契约(硬约束)
|
|
20
|
+
- 落到:`.dwy/prod/[项目]/02-需求规划/开发任务拆解.md`
|
|
21
|
+
- 固定章节:模块划分 / 每模块任务清单(含验证标准)/ 依赖顺序
|
|
22
|
+
- 回写 state.json:`confirmed.tasks`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-tdd-dev
|
|
3
|
+
description: "【dwy·TDD开发】产品 0 到 1 开发阶段。触发场景:用户说『开始开发 / 写代码 / TDD 开发 / 按任务开发 / 实现功能 / tdd』,要按模块循环 RED→GREEN→REFACTOR 开发并自动推进时。单元测试归此阶段。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一)
|
|
7
|
+
按模块循环 RED→GREEN→REFACTOR 开发,测试通过自动进下一模块(无人工逐模块验收)。单元测试归此阶段。
|
|
8
|
+
|
|
9
|
+
## 输入(从哪读)
|
|
10
|
+
- state.json 的 `confirmed.tasks`、`confirmed.architecture`、`confirmed.dev_progress`
|
|
11
|
+
- `.dwy/prod/[项目]/02-需求规划/开发任务拆解.md`
|
|
12
|
+
- `.dwy/prod/[项目]/03-设计与架构/技术架构.md`、`数据库设计.md`、`接口契约.md`
|
|
13
|
+
|
|
14
|
+
## 实现
|
|
15
|
+
[包装型] 用全局本地 skill(位于 `~/.dwy/skills/<外部skill名>/`):
|
|
16
|
+
读其 `SKILL.md`(及同目录 scripts/、配套 .md),按它的方式与用户交互/提问,产出按下方「产出契约」落地。
|
|
17
|
+
- 本 skill 依赖的外部 skill:`test-driven-development`、`systematic-debugging`(各对应 `~/.dwy/skills/<名>/`)
|
|
18
|
+
- 若 `~/.dwy/skills/<名>/` 不存在:提示用户先跑 `dwy skills install`(或 `dwy claude sync` 会自动装),不要自己用内置能力顶替。
|
|
19
|
+
|
|
20
|
+
每模块循环:RED 写失败测试 → GREEN 最小实现通过 → REFACTOR 重构。测试通过自动进下一模块。
|
|
21
|
+
|
|
22
|
+
## 产出契约(硬约束)
|
|
23
|
+
- 落到:项目源码目录 + 各模块单元测试 + `.dwy/prod/[项目]/09-开发日志.md`
|
|
24
|
+
- 固定章节(开发日志):模块进度 / 关键决策 / 遇到的问题与解法
|
|
25
|
+
- 回写 state.json:`confirmed.dev_progress.<module> = todo|done`(逐模块维护)
|
package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-validate/SKILL.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-validate
|
|
3
|
+
description: "【dwy·需求市场验证】产品 0 到 1 总闸门(闸1)。触发场景:用户说『验证需求 / 这需求是真的吗 / 有没有市场 / 需求验证 / 市场验证 / validate』,要在投入开发前确认需求真实存在且有市场时。这是总闸门,过不了流程直接停。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一)
|
|
7
|
+
验证需求真实存在 + 有市场,给出 pass/fail 结论。**总闸门**:过不了流程直接停,不进后续。
|
|
8
|
+
|
|
9
|
+
## 输入(从哪读)
|
|
10
|
+
- state.json 的 `confirmed.idea`、`confirmed.competitors`
|
|
11
|
+
- `.dwy/prod/[项目]/01-立项/想法收敛.md`、`竞品分析.md`
|
|
12
|
+
|
|
13
|
+
## 实现
|
|
14
|
+
[包装型] 用全局本地 skill(位于 `~/.dwy/skills/<外部skill名>/`):
|
|
15
|
+
读其 `SKILL.md`(及同目录 scripts/、配套 .md),按它的方式与用户交互/提问,产出按下方「产出契约」落地。
|
|
16
|
+
- 本 skill 依赖的外部 skill:`market-sizing`、`sentiment-analysis`、`interview-script`(各对应 `~/.dwy/skills/<名>/`)
|
|
17
|
+
- 若 `~/.dwy/skills/<名>/` 不存在:提示用户先跑 `dwy skills install`(或 `dwy claude sync` 会自动装),不要自己用内置能力顶替。
|
|
18
|
+
|
|
19
|
+
验证方式三选一:
|
|
20
|
+
- 搜索量/竞品热度(AI 自动)
|
|
21
|
+
- 落地页测点击
|
|
22
|
+
- 5 个目标用户访谈
|
|
23
|
+
|
|
24
|
+
## 产出契约(硬约束)
|
|
25
|
+
- 落到:`.dwy/prod/[项目]/01-立项/需求市场验证.md`
|
|
26
|
+
- 固定章节:验证方式 / 证据数据 / 市场判断 / **pass/fail 结论(含理由)**
|
|
27
|
+
- 回写 state.json:`confirmed.validation`(含 `pass` 布尔字段)
|
|
28
|
+
- **fail 时流程必须中断,不进闸2**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-version
|
|
3
|
+
description: "【dwy·版本规划】产品 0 到 1 需求规划阶段。触发场景:用户说『版本规划 / 排版本 / 版本路线图 / V1 做啥 V2 做啥 / roadmap』,要把 PRD 需求按版本切片排路线图时。准出复查 V1.0 范围不膨胀。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 职责(单一)
|
|
7
|
+
把 PRD 需求按版本切片,排出版本路线图。准出复查 V1.0 范围没膨胀。
|
|
8
|
+
|
|
9
|
+
## 输入(从哪读)
|
|
10
|
+
- state.json 的 `confirmed.prd`、`confirmed.mvp_features`
|
|
11
|
+
- `.dwy/prod/[项目]/02-需求规划/PRD.md`
|
|
12
|
+
|
|
13
|
+
## 实现
|
|
14
|
+
[包装型] 用全局本地 skill(位于 `~/.dwy/skills/<外部skill名>/`):
|
|
15
|
+
读其 `SKILL.md`(及同目录 scripts/、配套 .md),按它的方式与用户交互/提问,产出按下方「产出契约」落地。
|
|
16
|
+
- 本 skill 依赖的外部 skill:`outcome-roadmap`、`prioritize-features`(各对应 `~/.dwy/skills/<名>/`)
|
|
17
|
+
- 若 `~/.dwy/skills/<名>/` 不存在:提示用户先跑 `dwy skills install`(或 `dwy claude sync` 会自动装),不要自己用内置能力顶替。
|
|
18
|
+
|
|
19
|
+
## 产出契约(硬约束)
|
|
20
|
+
- 落到:`.dwy/prod/[项目]/02-需求规划/版本路线图.md`
|
|
21
|
+
- 固定章节:版本切片(V1.0/V1.x/V2.0…)/ 各版本目标 / V1.0 范围准出复查
|
|
22
|
+
- **V1.0 范围超出 MVP 清单直接告警,强制收敛**
|
|
23
|
+
- 回写 state.json:`confirmed.version_plan`
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dwy-github-action-publish
|
|
3
|
+
description: "GitHub Actions 打包分发避坑指南。先判断场景,再读取对应配置。场景 1:Python 含 C 扩展 / Cython / .so 的跨平台 wheel,用 cibuildwheel 构建并通过 PyPI Trusted Publisher(OIDC) 发布。场景 2:Electron 桌面应用多平台打包分发,用 electron-builder / electron-forge 在 macOS / Windows / Linux runner 上构建并发布 GitHub Release。覆盖 workflow YAML 解析、runner image 退役、matrix 拆分、跨平台 shell 引号、artifact/release、PyPI OIDC、Electron 签名/公证/Linux 依赖/产物命名等高频坑。触发条件:编辑或新建 .github/workflows/*.yml、用户说 GitHub Actions 打包 / 跨平台打包 / cibuildwheel / wheel build / Electron 打包 / electron-builder / electron-forge / GitHub Release 分发 / runner queued / workflow build 失败。也作为 dwy-publish 发版编排的 GA 打包子能力被主动调用。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# dwy-github-action-publish — GitHub Actions 打包分发避坑
|
|
7
|
+
|
|
8
|
+
定位:使用 GitHub Actions 做跨平台构建、打包、发布时,先判定产物类型,再查对应配置避坑。
|
|
9
|
+
|
|
10
|
+
本 skill 只处理 CI 打包分发链路。通用发版流程(测试 / bump / changelog / tag)走 `dwy-publish`;SDK 发布前安全审计走 `dwy-sdk-spec`;纯 Python 包不需要 cibuildwheel。
|
|
11
|
+
|
|
12
|
+
实战来源:
|
|
13
|
+
|
|
14
|
+
- Python wheel:quant-sdk 0.4.0 首发 PyPI 的 cibuildwheel 踩坑。
|
|
15
|
+
- Electron:某 Electron 桌面应用多平台打包(release.yml + build.yml + pack.mjs)实战配置。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 先判断场景
|
|
20
|
+
|
|
21
|
+
先读用户目标和仓库配置,不要直接套模板。
|
|
22
|
+
|
|
23
|
+
| 场景 | 判断依据 | 必读配置 |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| Python wheel | `pyproject.toml` 含 `Cython` / `ext_modules` / `Extension` / 产物含 `.so` / 用户提 `cibuildwheel`、`wheel`、`PyPI` | `.github/workflows/*.yml`、`pyproject.toml`、`setup.py` / `setup.cfg`、`tests/` |
|
|
26
|
+
| Electron 桌面应用 | `package.json` 含 `electron` + `electron-builder` / `electron-forge`,用户提 Electron 多平台打包、GitHub Release、`dmg` / `exe` / `AppImage` | `.github/workflows/*.yml`、`package.json`、`electron-builder` 配置、`forge.config.*`、打包脚本 |
|
|
27
|
+
|
|
28
|
+
如果同时存在两个场景,拆成两个 workflow 或两个 job 组分别处理。不要把 Python wheel 的 PyPI OIDC 规则套到 Electron,也不要把 Electron 的签名/产物规则套到 Python wheel。
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 通用 GitHub Actions 检查
|
|
33
|
+
|
|
34
|
+
改任何 workflow 后先做这些检查。
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 1. YAML 必须能本地解析
|
|
38
|
+
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))"
|
|
39
|
+
|
|
40
|
+
# 2. 检查 workflow 触发条件
|
|
41
|
+
gh workflow list
|
|
42
|
+
gh run list --workflow=release.yml --limit=5
|
|
43
|
+
|
|
44
|
+
# 3. run 几秒 fail 且 jobs 为空,多半是 YAML 解析失败
|
|
45
|
+
gh run view <run-id> --json jobs,conclusion
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
通用坑:
|
|
49
|
+
|
|
50
|
+
- GitHub Action 不一定有 `v<N>` major alias。改 `uses:` 前查对应仓库 tag。
|
|
51
|
+
- `run` / `env` 值里含 `:`、`=:all:`、`http://`、`${{ }}` 组合时,优先整体加引号。
|
|
52
|
+
- matrix 不要默认 `fail-fast: true`。跨平台打包应设 `fail-fast: false`,保留其他平台产物和日志。
|
|
53
|
+
- 不要使用退役 runner:`macos-13` / `macos-12` / `macos-11` / `ubuntu-20.04` 等会排队或失败。先查 `actions/runner-images` 当前 supported labels。
|
|
54
|
+
- 长时间卡 `Waiting for a runner to pick up this job...`,优先怀疑 runner label 已退役或额度/架构不可用。
|
|
55
|
+
- 发布 GitHub Release 需要 `permissions: contents: write`。
|
|
56
|
+
- PyPI Trusted Publisher 需要 `permissions: id-token: write`,并绑定 workflow 和 environment。
|
|
57
|
+
- artifact 名称必须包含平台和架构,避免多个 matrix 上传时互相覆盖。
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 场景 1:Python Cython wheel + PyPI OIDC
|
|
62
|
+
|
|
63
|
+
适用:含 Cython 编译扩展的 Python 包、跨平台 wheel 分发(linux x86_64/aarch64 + macOS x86_64/arm64 + Windows AMD64)、GitHub Actions + cibuildwheel + PyPI Trusted Publisher OIDC 发版。
|
|
64
|
+
|
|
65
|
+
模板:复制 `./references/release-workflow-template.yml` 到目标项目 `.github/workflows/release.yml`,只改:
|
|
66
|
+
|
|
67
|
+
1. `package-dir: <PACKAGE_DIR>`:实际 SDK 子目录;单包仓库填 `.` 或省略。
|
|
68
|
+
2. `CIBW_BUILD`:按需调整 Python 版本枚举。
|
|
69
|
+
|
|
70
|
+
### Python 必查配置
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
rg -n "Cython|ext_modules|Extension|cibuildwheel|pypa/gh-action-pypi-publish|license|version" pyproject.toml setup.py setup.cfg .github/workflows
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
检查点:
|
|
77
|
+
|
|
78
|
+
- `[build-system].requires` 含 `setuptools>=77`、`packaging>=24.2`、`wheel`、`Cython>=3.0.10`。
|
|
79
|
+
- `pypa/cibuildwheel` 用 minor tag 或精确 tag,例如 `pypa/cibuildwheel@v3.4`,不要写 `@v3`。
|
|
80
|
+
- monorepo 用 `with.package-dir`,测试命令使用 `{package}`,不要用 `{project}/tests`。
|
|
81
|
+
- 跨平台 shell 参数用外单内双:`'pytest {package}/tests -v -k "not requires_server"'`。
|
|
82
|
+
- Linux 依赖 pyarrow / pandas / numpy / scipy / lxml 时,manylinux 镜像用 `manylinux_2_28`。
|
|
83
|
+
- test 阶段大依赖用 binary-only 预装:`CIBW_BEFORE_TEST: "pip install --only-binary=:all: pyarrow pandas"`。
|
|
84
|
+
- macOS x86_64 用 `macos-15-intel`,不要用 `macos-13`。
|
|
85
|
+
- 默认只发布 wheel。不要发布 sdist,避免 Cython 编译模块源码随 sdist 泄漏。
|
|
86
|
+
|
|
87
|
+
### Python 8 个高频坑
|
|
88
|
+
|
|
89
|
+
#### 坑 1:PEP 639 license expression 触发 build env 依赖冲突
|
|
90
|
+
|
|
91
|
+
症状:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
ImportError: Cannot import `packaging.licenses`.
|
|
95
|
+
Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
根因:`pyproject.toml` 用 `license = "MIT"` 时,setuptools 77+ 校验 license expression 依赖 `packaging>=24.2`,cibuildwheel 临时 build env 可能装到旧 packaging。
|
|
99
|
+
|
|
100
|
+
修复:
|
|
101
|
+
|
|
102
|
+
```toml
|
|
103
|
+
[build-system]
|
|
104
|
+
requires = [
|
|
105
|
+
"setuptools>=77",
|
|
106
|
+
"packaging>=24.2",
|
|
107
|
+
"wheel",
|
|
108
|
+
"Cython>=3.0.10",
|
|
109
|
+
]
|
|
110
|
+
build-backend = "setuptools.build_meta"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### 坑 2:cibuildwheel action 必须用 minor 级或精确 tag
|
|
114
|
+
|
|
115
|
+
症状:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
Unable to resolve action `pypa/cibuildwheel@v3`, unable to find version `v3`
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
修复:
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
- uses: pypa/cibuildwheel@v3.4
|
|
125
|
+
# 或
|
|
126
|
+
- uses: pypa/cibuildwheel@v3.4.1
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### 坑 3:YAML 字符串含冒号必须加引号
|
|
130
|
+
|
|
131
|
+
错误:
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
CIBW_BEFORE_TEST: pip install --only-binary=:all: pyarrow
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
正确:
|
|
138
|
+
|
|
139
|
+
```yaml
|
|
140
|
+
CIBW_BEFORE_TEST: "pip install --only-binary=:all: pyarrow pandas"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### 坑 4:CIBW_TEST_COMMAND 用 `{package}` 不要用 `{project}`
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
- uses: pypa/cibuildwheel@v3.4
|
|
147
|
+
with:
|
|
148
|
+
package-dir: quant-sdk
|
|
149
|
+
env:
|
|
150
|
+
CIBW_TEST_COMMAND: 'pytest {package}/tests -v -k "not requires_server"'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### 坑 5:跨平台 shell 引号必须外单内双
|
|
154
|
+
|
|
155
|
+
错误:
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
CIBW_TEST_COMMAND: "pytest {package}/tests -v -k 'not requires_server'"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
正确:
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
CIBW_TEST_COMMAND: 'pytest {package}/tests -v -k "not requires_server"'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### 坑 6:manylinux 镜像必须升到 `_2_28`
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
env:
|
|
171
|
+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
|
|
172
|
+
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### 坑 7:测试阶段三方依赖必须强制 binary
|
|
176
|
+
|
|
177
|
+
```yaml
|
|
178
|
+
env:
|
|
179
|
+
CIBW_TEST_REQUIRES: pytest pytest-asyncio respx
|
|
180
|
+
CIBW_BEFORE_TEST: "pip install --only-binary=:all: pyarrow pandas"
|
|
181
|
+
CIBW_TEST_COMMAND: 'pytest {package}/tests -v -k "not requires_server"'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### 坑 8:macos-13 runner 已退休
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
matrix:
|
|
188
|
+
include:
|
|
189
|
+
- { os: ubuntu-latest, archs: x86_64 }
|
|
190
|
+
- { os: ubuntu-24.04-arm, archs: aarch64 }
|
|
191
|
+
- { os: macos-15-intel, archs: x86_64 }
|
|
192
|
+
- { os: macos-14, archs: arm64 }
|
|
193
|
+
- { os: windows-latest, archs: AMD64 }
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 场景 2:Electron 多平台打包 + GitHub Release
|
|
199
|
+
|
|
200
|
+
适用:Electron 桌面应用需要在 GitHub Actions 产出 macOS / Windows / Linux 安装包,并上传到 GitHub Release。
|
|
201
|
+
|
|
202
|
+
参考配置:
|
|
203
|
+
|
|
204
|
+
- `./references/electron-release-workflow-template.yml`
|
|
205
|
+
|
|
206
|
+
### Electron 必查配置
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
rg -n "electron|electron-builder|electron-forge|pack|dist|dmg|AppImage|nsis|appx|CSC|notar|publish|artifactName|extraResources|asar|submodules" package.json .github/workflows script src -g '!node_modules'
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
检查点:
|
|
213
|
+
|
|
214
|
+
- `package.json` 明确 `electron` 和打包工具版本,例如 `electron-builder`。
|
|
215
|
+
- workflow 用 `actions/checkout@v4`,项目依赖 submodule 时必须 `submodules: true`。
|
|
216
|
+
- Node 版本固定,例如 `actions/setup-node@v4` + `node-version: 20`。
|
|
217
|
+
- 使用锁文件安装:npm 项目用 `npm ci`,pnpm 项目用 `pnpm install --frozen-lockfile`。
|
|
218
|
+
- 每个平台在对应 runner 上打包,不要指望一个 Linux runner 交叉产出 macOS / Windows 完整安装包。
|
|
219
|
+
- macOS x64 和 arm64 分开:x64 用 `macos-15-intel`,arm64 用 `macos-latest` / `macos-14`。
|
|
220
|
+
- Linux AppImage 需要系统依赖,常见为 `icnsutils graphicsmagick xz-utils`。
|
|
221
|
+
- Linux runner 上 `apt-get update` 前可移除易失效的 Microsoft / Azure apt source,避免第三方源拖死打包。
|
|
222
|
+
- 未配置证书但要产出 unsigned 包时,设置 `CSC_IDENTITY_AUTO_DISCOVERY: false`,避免 electron-builder 自动找证书导致 macOS job 失败。
|
|
223
|
+
- 产物命名必须包含 `${version}`、`${os}`、`${arch}`,避免 Release asset 覆盖。
|
|
224
|
+
- upload-artifact 只上传最终安装包:`*.dmg`、`*.exe`、`*.AppImage`;不要上传 `win-unpacked/`。
|
|
225
|
+
- GitHub Release job 需要 `permissions: contents: write`,用 `actions/download-artifact@v4` + `merge-multiple: true` 汇总产物。
|
|
226
|
+
|
|
227
|
+
### Electron 推荐 workflow 形态
|
|
228
|
+
|
|
229
|
+
模板:复制 `./references/electron-release-workflow-template.yml` 到目标项目 `.github/workflows/release.yml`,再按项目实际包管理器、打包脚本、签名策略调整。完整 workflow 见该模板,下方高频坑解释各关键配置的原因。
|
|
230
|
+
|
|
231
|
+
### Electron 多平台高频坑
|
|
232
|
+
|
|
233
|
+
#### 坑 1:macOS x64 / arm64 不能混跑
|
|
234
|
+
|
|
235
|
+
macOS x64 用 `macos-15-intel`。macOS arm64 用 `macos-latest` / `macos-14`。不要用已退役的 `macos-13`。
|
|
236
|
+
|
|
237
|
+
#### 坑 2:Linux 打 AppImage 缺系统依赖
|
|
238
|
+
|
|
239
|
+
症状通常是图标转换、压缩、AppImage 生成失败。
|
|
240
|
+
|
|
241
|
+
```yaml
|
|
242
|
+
sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### 坑 3:Ubuntu 第三方 apt 源拖死 `apt-get update`
|
|
246
|
+
|
|
247
|
+
GitHub hosted runner 预置源会变化。第三方源异常时,先移除无关 source。
|
|
248
|
+
|
|
249
|
+
```yaml
|
|
250
|
+
sudo rm -f /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.list
|
|
251
|
+
sudo apt-get update
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### 坑 4:未签名构建被 electron-builder 自动证书探测拖死
|
|
255
|
+
|
|
256
|
+
公开 unsigned 包或暂未配置证书时:
|
|
257
|
+
|
|
258
|
+
```yaml
|
|
259
|
+
env:
|
|
260
|
+
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
如果需要签名/公证,显式配置 secrets:`CSC_LINK`、`CSC_KEY_PASSWORD`、`APPLE_ID`、`APPLE_APP_SPECIFIC_PASSWORD`、`APPLE_TEAM_ID`。不要同时依赖自动探测。
|
|
264
|
+
|
|
265
|
+
#### 坑 5:产物名不含平台架构导致 Release 覆盖
|
|
266
|
+
|
|
267
|
+
electron-builder 配置应使用稳定命名:
|
|
268
|
+
|
|
269
|
+
```js
|
|
270
|
+
artifactName: '${productName}-${version}-${os}-${arch}.${ext}'
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### 坑 6:只上传最终安装包
|
|
274
|
+
|
|
275
|
+
推荐:
|
|
276
|
+
|
|
277
|
+
```yaml
|
|
278
|
+
path: |
|
|
279
|
+
release/**/*.dmg
|
|
280
|
+
release/**/*.exe
|
|
281
|
+
release/**/*.AppImage
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
需要自动更新时再上传 `*-latest.yml`。不要上传 `win-unpacked/`。
|
|
285
|
+
|
|
286
|
+
#### 坑 7:外部二进制资源必须在打包前下载
|
|
287
|
+
|
|
288
|
+
如果应用依赖 ADB、scrcpy server、native helper、Java/Android 构建产物,必须在 `npm run pack` 前完成下载或构建,并确保路径进入 `extraResources` / `files`。
|
|
289
|
+
|
|
290
|
+
#### 坑 8:Release job 必须先汇总 artifact 再发布
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
- uses: actions/download-artifact@v4
|
|
294
|
+
with:
|
|
295
|
+
path: artifacts
|
|
296
|
+
merge-multiple: true
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
发布前用 `find artifacts -type f` 打印文件列表,确认平台产物齐全。
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 安全重发流程
|
|
304
|
+
|
|
305
|
+
### Python PyPI
|
|
306
|
+
|
|
307
|
+
前提:PyPI 上还没有 publish 成功该版本号。PyPI 版本号一旦发布成功,永久不可复用,必须 bump 下一个版本。
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
gh run cancel <run-id>
|
|
311
|
+
git add <修改文件>
|
|
312
|
+
git commit -m "ci(sdk): 修复 xxx"
|
|
313
|
+
git push origin main
|
|
314
|
+
git push origin :refs/tags/v0.4.0
|
|
315
|
+
git tag -d v0.4.0
|
|
316
|
+
git tag v0.4.0
|
|
317
|
+
git push origin v0.4.0
|
|
318
|
+
gh run watch "$(gh run list --workflow=release.yml --limit=1 --json databaseId --jq '.[0].databaseId')" --exit-status
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Electron GitHub Release
|
|
322
|
+
|
|
323
|
+
如果 GitHub Release 已创建但产物错误,优先删错 release / tag 后重打,或 bump 版本。不要在同 tag 上混入不同 commit 的产物。
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
gh release view v1.2.3
|
|
327
|
+
gh release delete v1.2.3 --cleanup-tag
|
|
328
|
+
git tag v1.2.3
|
|
329
|
+
git push origin v1.2.3
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
执行删除前必须确认用户允许,因为这会删除远端 release / tag。
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 不要做
|
|
337
|
+
|
|
338
|
+
- 不要在本地跑 `python -m build && twine upload` 替代跨平台 wheel 发布。
|
|
339
|
+
- 不要给 Cython 包发布 sdist,除非明确接受源码泄漏。
|
|
340
|
+
- 不要假设 GitHub Action 有 major moving tag。
|
|
341
|
+
- 不要跳过 workflow YAML 本地解析。
|
|
342
|
+
- 不要用退役 runner label。
|
|
343
|
+
- 不要让多个 matrix 上传同名 artifact。
|
|
344
|
+
- 不要在 Electron 未配置签名时依赖证书自动探测。
|
|
345
|
+
- 不要把 `win-unpacked/`、中间目录、缓存目录发进 Release。
|
|
346
|
+
- 不要在一个 runner 上硬交叉构建所有 Electron 平台。
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 违规检测清单
|
|
351
|
+
|
|
352
|
+
| 检查项 | 违规模式 | 严重程度 |
|
|
353
|
+
|---|---|---|
|
|
354
|
+
| YAML 解析 | env / run 含 `:` 未加引号,run 几秒 fail 且 jobs 为空 | 致命 |
|
|
355
|
+
| action tag | `pypa/cibuildwheel@v3` 等不存在 alias | 致命 |
|
|
356
|
+
| runner | `macos-13` / `macos-12` / `ubuntu-20.04` | 致命 |
|
|
357
|
+
| artifact | matrix 上传同名产物或未带平台架构 | 高 |
|
|
358
|
+
| Python build-system | PEP 639 license 但缺 `packaging>=24.2` | 致命 |
|
|
359
|
+
| Python test path | monorepo 子目录用 `{project}/tests` | 高 |
|
|
360
|
+
| Python shell 引号 | Windows 跨平台命令里用单引号包参数 | 高 |
|
|
361
|
+
| Python manylinux | 大型 C 库依赖仍用 manylinux2014 | 高 |
|
|
362
|
+
| Electron macOS | x64 / arm64 未拆 runner | 高 |
|
|
363
|
+
| Electron Linux | AppImage 缺 `icnsutils graphicsmagick xz-utils` | 高 |
|
|
364
|
+
| Electron 签名 | unsigned 构建未设 `CSC_IDENTITY_AUTO_DISCOVERY: false` | 中 |
|
|
365
|
+
| Electron Release | 上传 unpacked 中间目录或漏最终安装包 | 高 |
|