docs: reorganize reference area and unify directory READMEs
Reorganize the AI-agent documentation by function area:
- Move the plays/ application archive and experiences into docs/reference/, grouped by contributor <username>/ (flat experience entries + application subdirectories), with a single reference/README entry.
- Add a second level under docs/development/ (engineering/, ci/, release/); fold agent-guide into ai-guide; flatten the six project-completion sub-documents into one file.
- Unify each directory to a single README (drop every INDEX); fold assets/{fonts,images,music} README leaves into assets/README; remove the empty docs/software-design/.
- Add an upstream-PR rule: do not add or modify the repository-root README.
- Update all cross-references and bibliographic links (EN/ZH aligned); validate.sh --static passes. The repository-root README is left untouched.
This commit is contained in:
1 parent
545881ad1d
commit
cbede2d2fa
105 files changed
+1025
-1576
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<p align="right">
|
||||
<a href="CI-build-and-release.zh_CN.md">简体中文</a> · <strong>English</strong>
|
||||
</p>
|
||||
|
||||
# Automated Build and Release
|
||||
|
||||
`.github/workflows/build-firmware.yml` builds and publishes firmware for tags and supports manual dispatch. Ordinary branch pushes do not trigger it. Keep this page synchronized with the workflow.
|
||||
|
||||
The build job restores ccache, runs `./tools/validate.sh --firmware` with ESP-IDF 5.5.3 for ESP32-C3, verifies the bootloader at `0x0`, partition table at `0x8000`, application at `0x10000`, 8 MB Flash arguments, and the complete mini-program BLE compatibility contract, then uploads `FoloToy-AI-Passport-full.bin`. A separate least-privilege release job publishes that artifact only for a tag.
|
||||
|
||||
All Actions are pinned to full commit SHAs. The build job has `contents: read`; only the tag release job receives `contents: write`.
|
||||
|
||||
## Browser flashing
|
||||
|
||||
Open `https://ai-passport.folotoy.cn/tools/web-flasher/`, connect the USB JTAG/serial device, select the release's merged `FoloToy-AI-Passport-full.bin`, choose a baud rate such as 460800, and write it from `0x0`. The browser performs local writing and verification; it does not upload the firmware file.
|
||||
|
||||
For board and flashing details, see [the hardware development guide](../../hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md).
|
||||
|
||||
## Release title
|
||||
|
||||
When this repository publishes firmware for several different applications from
|
||||
the same source tree, a bare version number does not tell a user which app a
|
||||
release is for. Give each tag a name that carries the version and the app, and
|
||||
make sure the release title shows both.
|
||||
|
||||
- **Tag naming convention**: name tags as `v<version>-<app-name>` in
|
||||
lowercase-kebab-case, e.g. `v0.1.0-voice-keychain`, `v1.0.0-pocket-pomodoro`.
|
||||
The `<app-name>` is the application this release builds (see the
|
||||
`plays/<username>/<app-name>/` archive naming). A tag that only says a version
|
||||
is ambiguous when several apps share the tree.
|
||||
- **After the release is published, confirm the release title.** The workflow
|
||||
sets the title to the tag name, so a correctly-named tag already reads
|
||||
`v0.1.0-voice-keychain`. If the tag did not include the app, or the title is
|
||||
not obvious at a glance, edit the release (GitHub: `Edit release`; GitLab:
|
||||
edit the tag) so the title is `<version> <app-name>`, e.g. `v0.1.0 Voice
|
||||
Keychain`. One quick scan of the release list should distinguish which app a
|
||||
release is for.
|
||||
- **Keep title and tag consistent.** Use `<version>-<app-name>` so the app name
|
||||
is visible in both the tag list and the release list. Do not rely on a
|
||||
human-readable body alone to carry the app name.
|
||||
|
||||
## Release notes
|
||||
|
||||
A tag-triggered release succeeds only when the merged firmware and its release
|
||||
notes travel together. After the release is published, write release notes that
|
||||
explain the build to a user who may not have read the repository. Cover three
|
||||
things:
|
||||
|
||||
- **What's new**: the features, behaviors, or fixes this release adds or
|
||||
changes compared with the previous one. Keep it user-facing, not a commit log.
|
||||
- **How to build**: how to produce and verify the merged firmware
|
||||
(`./tools/validate.sh --firmware` or `idf.py build`), and the artifact file to
|
||||
flash (`FoloToy-AI-Passport-full.bin` flashed from `0x0`).
|
||||
- **How to use**: how to flash the build (the browser flasher above) and the key
|
||||
interactions or hardware requirements of the release.
|
||||
|
||||
Write the release notes in English (and a Simplified Chinese version where the
|
||||
project is bilingual) and link them from the GitHub/GitLab release. Keep them
|
||||
consistent with `docs/CHANGELOG.md` for user-visible behavior.
|
||||
|
||||
## Related documents
|
||||
|
||||
- Firmware publishing to the community: [publish-to-community.md](../release/publish-to-community.md)
|
||||
- Post-release follow-up: [project-completion.md](../release/project-completion.md)
|
||||
@@ -0,0 +1,73 @@
|
||||
<p align="right">
|
||||
<strong>简体中文</strong> · <a href="CI-build-and-release.md">English</a>
|
||||
</p>
|
||||
|
||||
# 自动构建与发布(CI / Build & Release)
|
||||
|
||||
本仓库提供一套基于 GitHub Actions 的自动构建与发布流水线,用于在打 tag 时自动编译固件并发布 Release。
|
||||
|
||||
本文件与 `.github/workflows/build-firmware.yml` 一同维护,工作流行为变化时必须同步更新。
|
||||
|
||||
## 触发条件
|
||||
|
||||
- **push tag**:当向仓库推送 tag(如 `v1.0.0`、`v0.1.0-feature/xxx`)时触发自动构建,并在构建成功后自动创建 Release(带固件产物)。
|
||||
- **workflow_dispatch**:可在 GitHub Actions 页面手动触发(用于调试/预发布验证)。
|
||||
|
||||
> 平时 push 到分支(非 tag)**不会**触发构建;只有打 tag 才会。
|
||||
|
||||
## 流水线做了什么
|
||||
|
||||
1. **ccache 缓存恢复**:使用 `actions/cache` 缓存编译中间产物(`.ccache`),二次编译大幅提速。缓存 key 含 ref 与 commit SHA;缓存保留时间以仓库的 GitHub Actions 设置为准。
|
||||
2. **编译与验证**(ESP-IDF 5.5.3 / esp32c3):运行与本地相同的 `./tools/validate.sh --firmware`。脚本使用 `sdkconfig.defaults` 和 `partitions.csv` 构建固件,再执行 `idf.py merge-bin`。
|
||||
3. **验证完整固件**:脚本逐字节确认 bootloader、partition-table 和 app 位于 `0x0`、`0x8000` 和 `0x10000`,确认 `flash_args` 使用 8 MB Flash,并完整检查小程序 BLE 兼容契约,最后输出 `build/FoloToy-AI-Passport-full.bin`。
|
||||
4. **上传 artifact**:每次成功构建都上传 `FoloToy-AI-Passport-full.bin`。普通分支只有从该分支手动运行 `workflow_dispatch` 才会构建;普通 push 不触发。
|
||||
5. **发布 tag**:tag 构建完成后,独立 release job 下载上述 artifact,并创建 GitHub Release。
|
||||
|
||||
构建 job 只有 `contents: read` 权限;仅 release job 在 tag 发布时获得 `contents: write`。所有 Action 均固定到完整 commit SHA,行尾注释保留对应发布版本,升级时需同时核对 SHA 与版本。
|
||||
|
||||
## 产物
|
||||
|
||||
- `FoloToy-AI-Passport-full.bin`:合并后的完整固件,可直接烧录(唯一产物)。
|
||||
|
||||
## 在线烧录
|
||||
|
||||
使用浏览器在本机完成写入与校验,固件不会上传服务器。打开 **在线刷机工具**:
|
||||
|
||||
`https://ai-passport.folotoy.cn/tools/web-flasher/`
|
||||
|
||||
步骤:连接设备(USB JTAG/serial debug unit)→ 选择本 Release 的合并固件 `FoloToy-AI-Passport-full.bin` → 选择波特率(如 460800)→ 开始写入。目标是 8MB Flash 板卡,无需其它参数。
|
||||
|
||||
## Release 标题
|
||||
|
||||
当本仓库从同一棵源码树发布多个不同应用时,只有版本号看不出这个 Release 是哪个应用。给每个 tag 起一个
|
||||
同时带版本与应用名的名字,并确保 Release 标题两者都显示。
|
||||
|
||||
- **Tag 命名约定**:按 `v<版本>-<应用名>` 小写连字符命名,例如 `v0.1.0-voice-keychain`、
|
||||
`v1.0.0-pocket-pomodoro`。`<应用名>` 是该 Release 构建的应用(见
|
||||
`plays/<username>/<app-name>/` 档案命名)。多应用共享同一棵树时,只写版本号的 tag 会有歧义。
|
||||
- **发布成功后,核对 Release 标题**:workflow 会把标题设为 tag 名,因此命名正确的 tag 本身就显示成
|
||||
`v0.1.0-voice-keychain`。若 tag 没带应用名,或标题一眼看不出是哪个应用,就编辑该 Release
|
||||
(GitHub:`Edit release`;GitLab:编辑 tag),让标题为 `<版本> <应用名>`,例如 `v0.1.0 Voice
|
||||
Keychain`。快速扫一遍 Release 列表,就能区分每个 Release 是哪个应用。
|
||||
- **标题与 tag 保持一致**:用 `<版本>-<应用名>`,让应用名在 tag 列表和 Release 列表里都可见。不要只靠
|
||||
人类可读的正文承载应用名。
|
||||
|
||||
## Release 说明
|
||||
|
||||
tag 触发的 Release 只有在合并固件与它的 Release 说明一起发布时才完整。发布 Release 后,要写一份
|
||||
说明,向可能没读过仓库的用户解释这次构建。覆盖三块:
|
||||
|
||||
- **功能(What's new / 功能)**:本次 Release 相对上一版新增或变更的功能、行为或修复。面向用户,
|
||||
不是 commit 日志。
|
||||
- **方法(How to build / 方法)**:如何生成并校验合并固件(`./tools/validate.sh --firmware` 或
|
||||
`idf.py build`),以及要烧录的产物文件(从 `0x0` 烧录的 `FoloToy-AI-Passport-full.bin`)。
|
||||
- **使用(How to use / 使用)**:如何烧录(上方在线刷机工具),以及本次 Release 的关键交互或硬件
|
||||
要求。
|
||||
|
||||
用英文写 Release 说明(项目双语时再配一份简体中文),并在 GitHub/GitLab Release 上链接它们。对
|
||||
用户可见的行为,保持与 `docs/CHANGELOG.md` 一致。
|
||||
|
||||
## 相关文件
|
||||
|
||||
- `.github/workflows/build-firmware.yml`:本流水线定义。
|
||||
- 详见 `docs/hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md`(硬件/烧录细节)。
|
||||
@@ -0,0 +1,13 @@
|
||||
<p align="right">
|
||||
<a href="CI-sync-main.zh_CN.md">简体中文</a> · <strong>English</strong>
|
||||
</p>
|
||||
|
||||
# Upstream Synchronization
|
||||
|
||||
`.github/workflows/sync-main.yml` synchronizes a fork's `main` branch with `FoloToy/ai-passport:main`. It runs daily at 00:00 UTC and by manual dispatch, and is skipped when the repository is not a fork.
|
||||
|
||||
The workflow checks out the target `main` without persisting credentials and uses the full-SHA-pinned upstream-sync Action. Its generated `GITHUB_TOKEN` has only `contents: write`; no manually configured token is required. If synchronization fails after an upstream workflow change, use GitHub's **Sync fork** once and inspect the Actions log.
|
||||
|
||||
Keep fork-specific firmware and documentation on feature branches so `main` stays synchronized. If development must happen directly on `main`, disable this workflow first to avoid automatic merges or conflicts. Fork owners must explicitly enable Actions after forking.
|
||||
|
||||
When upgrading an Action, verify the release and full commit SHA from the official repository and update the inline version comment.
|
||||
Loaded 3 of 105 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user