Skip to content

重构与优化构建流程,修复跨平台(non-Debian/Ubuntu Linux)构建 - #159

Open
VillagerTom wants to merge 9 commits into
appshubcc:mainfrom
VillagerTom:build_refactor2
Open

重构与优化构建流程,修复跨平台(non-Debian/Ubuntu Linux)构建#159
VillagerTom wants to merge 9 commits into
appshubcc:mainfrom
VillagerTom:build_refactor2

Conversation

@VillagerTom

@VillagerTom VillagerTom commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Feat:

  1. 将安装 apt 依赖、安装 appimagetool、appdmg 等步骤转移至 CI (build.yaml)
  2. setup.dart 添加检查构建环境并抛出警告
  3. 添加 CI 手动触发,手动触发时 IS_STABLE 为 false (建议安装 GitHub Actions ManagerGitHub Actions for VS Code) (已拆分至~~feat(ci): workflow dispatch #206~~Workflow dispatch fix #221)
  4. Linux 添加 zip 格式二进制包 (CI 未启用)
  5. Linux 添加 --targets 命令行参数,可指定打包格式
  6. 添加自动检测CPU架构(重构上游实现以与后续提交兼容),为宿主机平台构建时可省略 --arch 参数
  7. 添加 --build-only,用于跳过 flutter_distributor 打包
  8. Windows 添加 --out=core,helper, 方便本地调试 (上游已有等效实现)
  9. 在 README 中添加本地构建文档

Fix:

  1. 兼容 Clang>=21 and libayatana-appindicator>=0.5.94 构建环境 (已拆分至~~fix(build): Fix Linux build issues and optimize CI #215~~fix(build): 修复某些Linux发行版环境较新时构建失败 #223)
  2. 添加 Fluter 编译参数,削减 dmg 安装包体积 (胖二进制) (已拆分至feat: build macOS dmgs with correct archs #226)
  3. 修正 setup.dart 命令行帮助选项

(使用 OpenCode 辅助开发)

@appshubcc
appshubcc force-pushed the main branch 2 times, most recently from b9361df to c9593e0 Compare June 8, 2026 05:44
@VillagerTom
VillagerTom force-pushed the build_refactor2 branch 2 times, most recently from 545b73e to 1feddf8 Compare June 9, 2026 07:49
@VillagerTom
VillagerTom marked this pull request as draft June 26, 2026 15:18
@appshubcc
appshubcc force-pushed the main branch 2 times, most recently from 1b8e475 to 80e4667 Compare June 28, 2026 14:42
@VillagerTom
VillagerTom force-pushed the build_refactor2 branch 4 times, most recently from 615fe6d to 8d646c2 Compare July 2, 2026 05:24
@VillagerTom
VillagerTom marked this pull request as ready for review July 2, 2026 05:30
@VillagerTom

Copy link
Copy Markdown
Contributor Author

rebase 已完工,CI 和本地测试均已通过。请李师傅审查。

@VillagerTom

Copy link
Copy Markdown
Contributor Author

回退重命名的版本在 VillagerTom#1 ,diff 更干净。李师傅如果不喜欢重命名我可以 cherry-pick 过来。

@VillagerTom
VillagerTom force-pushed the build_refactor2 branch 2 times, most recently from c9bd24e to 18e4ab7 Compare July 4, 2026 09:58
@VillagerTom

Copy link
Copy Markdown
Contributor Author

抱歉,“添加 workflow dispatch”提交已清除。

@appshubcc

Copy link
Copy Markdown
Owner

@VillagerTom 本地调试验证了么

@VillagerTom

Copy link
Copy Markdown
Contributor Author

@VillagerTom 本地调试验证了么

验证过了

@VillagerTom

Copy link
Copy Markdown
Contributor Author

哦,如果说是这次同步main以后,还需要再次测试吗?我看到main构建流程没有更改

@VillagerTom

Copy link
Copy Markdown
Contributor Author

哦,如果说是这次同步main以后,还需要再次测试吗?我看到main构建流程没有更改

@appshubcc 本地调试通过。除原有的 https://t.me/appshub_chat/174594 (在main也存在) 没有新增bug。

@VillagerTom

VillagerTom commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

已丢弃 README*.md 修改,备份位于 VillagerTom@e60d271
CI 测试已通过 (https://github.com/VillagerTom/Bettbox/actions/runs/30903003710 ),Linux 本地构建已通过
图片
图片

@VillagerTom

Copy link
Copy Markdown
Contributor Author

哦不对,main 又更新了
更新了代码但没发 pre,有点害怕😳

@appshubcc

Copy link
Copy Markdown
Owner

@VillagerTom 这PR合了肯定炸,建议不要修改除了
非Debian/Ubuntu Linux构建流程
的任何地方,意义不大还徒增调试烦恼

@VillagerTom

VillagerTom commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

这PR合了肯定炸

哦也是,我的 CI 里没有 SignPath 的 secrets,构建环境不一致。要不然你打个 -test tag 测试一下炸不炸?

除了“非Debian/Ubuntu Linux构建流程”的任何地方

“重构与优化构建流程”基本服务于打包脚本,比如 0f7dc38 避免了根据 CARCH 选择构建参数, 1dfc64a 避免打包后再解包;为了统一性修改了通用函数。

@appshubcc

Copy link
Copy Markdown
Owner

@VillagerTom Windows的调试我看也改了下,现有可以稳定调试的情况下非必要一般还是不建议动

@VillagerTom

Copy link
Copy Markdown
Contributor Author

@VillagerTom Windows的调试我看也改了下,现有可以稳定调试的情况下非必要一般还是不建议动

是指 .vscode/* 吗?还是也包含其他地方?
cc @ZeonXr

@VillagerTom

Copy link
Copy Markdown
Contributor Author

等一下,构建环境有一些依赖变化我忘了更新了

@VillagerTom
VillagerTom force-pushed the build_refactor2 branch 2 times, most recently from b67f841 to 602acb3 Compare August 6, 2026 19:00
@VillagerTom

Copy link
Copy Markdown
Contributor Author

等一下,构建环境有一些依赖变化我忘了更新了

更新以下 checkDeps:

  • 全平台 build app: cmd +rustup
  • Android build app: default NDK 27.0.12077973 -> 28.2.13676358

@VillagerTom

Copy link
Copy Markdown
Contributor Author

为 Windows debug 流程添加了纯 powershell 命令,避免 jq 依赖

@VillagerTom

Copy link
Copy Markdown
Contributor Author

已 rebase 至 v1.18.9, CI 构建通过

@VillagerTom

Copy link
Copy Markdown
Contributor Author

为 Windows debug 流程添加了纯 powershell 命令,避免 jq 依赖

Windows 调试运行失败🤡
无标题

@VillagerTom

Copy link
Copy Markdown
Contributor Author

为 Windows debug 流程添加了纯 powershell 命令,避免 jq 依赖

Windows 调试运行失败🤡 无标题

😮我什么都没动,这次运行成功了,而且再也没失败
图片

- [target -> platform] 与 flutter_distributor 保持一致
- [Target -> TargetPlatform] 语义一致
- [Mode -> CoreMode] (顶级枚举) 表意更清晰
- [TargetPlatform.same -> TargetPlatform.same, TargetPlatform.buildable] 职责明确
删除 setup.dart Linux 分支的 targets 硬编码,改为从 CI 输入
- check linux and macos dependencies that were installed in the previous
  removed steps
- check cargo and inno-setup for windows
- specify and check ndk 27.0.12077973 for android build core, if env
  ANDROID_NDK is not set
- prevent building app for unbuildable target platforms
- prevent cross-builds for windows and linux target
…wait

- Replace --arch auto flag with implicit fallback via ArchExt.same
- Remove systemArch/_mapHostArch (superseded by ArchExt.same)
- Keep _expectedOutputs etc. for --ensure support
- Add missing awaits for buildHelper and _buildDistributor calls
- Consolidate .vscode/ tasks and launch configs into single auto-detecting entries
- valueHelp 改为 allowed,拦截无效命令行参数
- 添加 abbr,支持短格式参数
- 修复错误的判断条件和说明
@VillagerTom

VillagerTom commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

已 rebase 至 v1.18.10-pre3, CI 通过,Windows 调试与 main 表现相同。
重写了 tasks.json 中的 powershell 命令,使用了更稳健的 powershell 对象语法,解决了前述 preLaunchTask 随机崩溃问题(沟槽的被 DS 坑了,给我写了个用正则逐行过滤 flutter devices --machine 的输出)

@VillagerTom

Copy link
Copy Markdown
Contributor Author

这PR合了肯定炸

哦也是,我的 CI 里没有 SignPath 的 secrets,构建环境不一致。要不然你打个 -test tag 测试一下炸不炸?

除了“非Debian/Ubuntu Linux构建流程”的任何地方

“重构与优化构建流程”基本服务于打包脚本,比如 0f7dc38 避免了根据 CARCH 选择构建参数, 1dfc64a 避免打包后再解包;为了统一性修改了通用函数。

图片

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