Skip to content

ci: 精简 GitHub Actions 为 release + pr_check 两个 workflow - #117

Merged
qinshah merged 1 commit into
dev4harmony:ohosfrom
qinshah:ohos
Jul 21, 2026
Merged

ci: 精简 GitHub Actions 为 release + pr_check 两个 workflow#117
qinshah merged 1 commit into
dev4harmony:ohosfrom
qinshah:ohos

Conversation

@qinshah

@qinshah qinshah commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

优化 GitHub Actions:只保留 release 和 pr_check 两个 workflow

变更内容

将原本的多个 workflow 精简/合并为两个:

1. release.yml(发布用)

  • 触发:push tag / workflow_dispatch
  • 核心流程:checkout → 提取 tag(非 tag 触发时回退到 git describe,并清理路径中的 /)→ 安装 ohos sdk / jdk17 / flutter-ohos → dart .vscode/build_env.dart 生成 .vscode/env.json → flutter pub get → 重命名包为 piliplus → 构建 ohos hap → 上传草稿 release
  • 不再用 pili_release.json,不再依赖 ps1 脚本

2. pr_check.yml(PR 检查用)

  • 触发:PR opened/synchronize/reopened/ready_for_review / workflow_dispatch
  • 仅运行 flutter pub get + dart analyze --no-fatal-warnings
  • 只在有 error 级别问题时失败,info/warning 不算报错(避免 vendored Flutter widgets 中的遗留 lint 影响 PR 检查)

删除的内容

  • 旧 workflow:build.ymlios.ymllinux_x64.ymlmac.ymltest.ymlwin_x64.ymlrelease.yaml
  • PowerShell 脚本:lib/scripts/build.ps1lib/scripts/patch.ps1

验证结果

两个 workflow 已在 qinshah/PiliPlusfeat/ci 分支上手动触发并全部通过:

完整的 Actions 运行历史可以到 https://github.com/qinshah/PiliPlus/actions 查看。

调整过程中遇到的问题及修复

  1. easimon/maximize-build-space 占满根分区导致 runner 日志写不下去 → 已移除
  2. flutter-version-file: pubspec.yaml 无法解析 >=3.41.9 约束 → 改用 flutter-version: "3.41.9"
  3. flutter pub get 在 LFS 缺失对象时报错 → 加上 GIT_LFS_SKIP_SMUDGE: 1
  4. workflow_dispatch 触发时 ${{ env.tag }}/ 导致 cp 路径非法 → 改用 git describe 回退并清理 /
  5. dart analyze 默认把 info/warning 算作 fatal → 用 --no-fatal-warnings 只对 error 失败

Optimize GitHub Actions to only two workflows:

- release.yml: build & release ohos hap. Uses dart .vscode/build_env.dart
  to generate .vscode/env.json only (drops pili_release.json and ps1
  scripts). All other actions deleted.
- pr_check.yml: runs `dart analyze --no-fatal-warnings` on PRs so the
  check fails only on actual errors, not on info/warning lints in
  vendored Flutter widgets under lib/common/widgets/flutter/.

Removed:
  .github/workflows/{build,ios,linux_x64,mac,test,win_x64}.yml
  .github/workflows/release.yaml
  lib/scripts/{build,patch}.ps1

Verification: both workflows have been manually triggered and passed
on the feat/ci branch. Run history available at:
  https://github.com/qinshah/PiliPlus/actions
  - release:  https://github.com/qinshah/PiliPlus/actions/runs/29766727213
  - pr_check: https://github.com/qinshah/PiliPlus/actions/runs/29768632667
@qinshah
qinshah merged commit 463e135 into dev4harmony:ohos Jul 21, 2026
1 check passed
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.

1 participant