docs: make English the default documentation language

This commit is contained in:
cjiio committed 2026-08-25 19:48:32 +08:00
1 parent c57982e032
commit 3c2bdcb7b6
55 files changed
+1920 -893

No files matched your search

+10 -32
View File
@@ -1,39 +1,17 @@
# 自动构建与发布(CI / Build & Release)
<p align="right">
<a href="CI-build-and-release.zh_CN.md">简体中文</a> · <strong>English</strong>
</p>
本仓库提供一套基于 GitHub Actions 的自动构建与发布流水线,用于在打 tag 时自动编译固件并发布 Release。
# Automated Build and Release
本文件与 `.github/workflows/build-firmware.yml` 一同维护,工作流行为变化时必须同步更新。
`.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`, and 8 MB Flash arguments, then uploads `FoloToy-AI-Passport-full.bin`. A separate least-privilege release job publishes that artifact only for a tag.
- **push tag**:当向仓库推送 tag(如 `v1.0.0`、`v0.1.0-feature/xxx`)时触发自动构建,并在构建成功后自动创建 Release(带固件产物)。
- **workflow_dispatch**:可在 GitHub Actions 页面手动触发(用于调试/预发布验证)。
All Actions are pinned to full commit SHAs. The build job has `contents: read`; only the tag release job receives `contents: write`.
> 平时 push 到分支(非 tag)**不会**触发构建;只有打 tag 才会。
## 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.
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,并输出可从 `0x0` 直刷的 `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 板卡,无需其它参数。
## 相关文件
- `.github/workflows/build-firmware.yml`:本流水线定义。
- 详见 `docs/hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md`(硬件/烧录细节)。
For board and flashing details, see [the hardware development guide](../hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md).
@@ -0,0 +1,43 @@
<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,并输出可从 `0x0` 直刷的 `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 板卡,无需其它参数。
## 相关文件
- `.github/workflows/build-firmware.yml`:本流水线定义。
- 详见 `docs/hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md`(硬件/烧录细节)。
+8 -24
View File
@@ -1,29 +1,13 @@
# 上游同步(CI / Upstream Sync)
<p align="right">
<a href="CI-sync-main.zh_CN.md">简体中文</a> · <strong>English</strong>
</p>
本仓库提供一套基于 GitHub Actions 的自动上游同步流水线,用于定期把上游 `FoloToy/ai-passport` 的 `main` 分支更新同步到本 fork 的 `main` 分支。
# Upstream Synchronization
本文件与 `.github/workflows/sync-main.yml` 一同维护,工作流行为变化时必须同步更新。
`.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.
- **schedule**:每天 00:00(UTC)自动运行一次。
- **workflow_dispatch**:可在 GitHub Actions 页面手动触发(用于立即同步/排查问题)。
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.
> 该工作流仅在仓库为 **fork** 时生效(`if: github.event.repository.fork`);非 fork 仓库不运行。
## 流水线做了什么
1. **Checkout 目标仓库**:`actions/checkout` 检出当前 fork 的 `main` 分支,并关闭 Git 凭证持久化。
2. **同步上游**:使用固定到完整 commit SHA 的 `aormsby/fork-sync-with-upstream-action`(对应 v3.4.3),把 `FoloToy/ai-passport` 的 `main` 同步到本 fork 的 `main`。`target_repo_token` 使用自动生成且仅具 `contents: write` 权限的 `GITHUB_TOKEN`,无需手动配置。
3. **失败检查**:同步失败时输出提示——上游 workflow 文件变更可能导致 GitHub 暂停自动同步,需手动 Sync Fork 一次。
## 注意事项
- 同步目标与上游分支均为 `main`,与 fork 用户约定(`main` 仅允许修改根目录 `README.md` 与 `docs/assets/`)配合使用:`main` 保持与上游最新基线同步、不产生冲突。
- **在 `main` 直接开发的例外**:如果用户执意要在 `main` 分支直接开发,必须**停用/关闭本 workflow**(Actions 页面 → Disable),否则每日自动同步会把上游改动强行合入 `main`,产生冲突或覆盖本地开发内容。
- 若同步失败,查看 Actions 日志确认是否为上游 workflow 文件变更所致;必要时按提示手动在 GitHub 页面 Sync Fork。
- 升级 Action 时必须从官方仓库核对目标版本对应的完整 commit SHA,并同步更新 workflow 行尾的版本注释。
## 相关文件
- `.github/workflows/sync-main.yml`:本流水线定义。
When upgrading an Action, verify the release and full commit SHA from the official repository and update the inline version comment.
Loaded 3 of 55 files, more files were not shown because too many files have changed in this diff. Show more