flutter_ci_tools 0.2.0
flutter_ci_tools: ^0.2.0 copied to clipboard
Reusable CI tooling for Flutter apps — build orchestration, git versioning, deploy services, and structured logging.
0.2.0 #
⚠️ Breaking Changes #
FeishuNotifyAction/FeishuBuildNotifyAction的shellRunner参数换成httpPoster(类型HttpPoster)。只影响为测试注入假对象的调用方,正常构造 不受影响- 删除
DeployTarget枚举,FeishuBuildNotifyAction.target改收String。 它唯一的用途是往通知标题里填一个括号里的名字(🚀 App 新版本 12042 (Pgyer)),没有任何代码 switch 它,枚举只是逼调用方多 import 一个类型、 且发到枚举里没有的渠道时还得先改库。迁移:DeployTarget.pgyer→'Pgyer',DeployTarget.googlePlay→'Google Play',DeployTarget.appStore→'App Store'
♻️ Refactoring #
FeishuBuildNotifyAction改为继承FeishuNotifyAction,只覆写新增的buildMessage()生成正文。此前它在run()里 new 一个平级 Action 再调用, 两个PipelineAction嵌套执行,参数也要一个个手工透传。子类只做“消息怎么写”, 发送、重试、错误处理都留在父类- 飞书通知改用
dart:io的HttpClient发送,不再 fork curl 进程。新增HttpPoster/HttpPosterImpl(postJson)。收益是拿得到真实状态码——此前 HTTP 400 只能打出curl exited with 22,现在是HTTP 400: <响应体>;代价是HttpClient默认不读代理环境变量,HttpPosterImpl里已显式补上findProxyFromEnvironment。pgyer 的 multipart 文件上传仍走 curl
📚 Documentation #
- 修正
example/README.md:流水线示例还停留在重构前的 API(BuildPipeline基类、context.platforms/AppPlatform分平台判断、Action 有返回值、 “没有字符串键的 context store”),另有exampleConfig、writeBuildInfo、CollectMetadataAction、build_info_writer.dart、test_pipeline.dart等一批已不存在的符号。现按真实的ci/pipelines/prod_pipeline.dart重写
✅ Tests #
- 单元测试 134 → 99。砍掉的是「测语言本身」的用例(断言 enum 有几个值、
status = X后再断言status == X、expect(action, isA<自己>()))和同一 分支重复测多遍的(get()缺 key 抛StateError测了 3 遍),断言覆盖没有 减少
0.1.3 #
🐛 Bug Fixes #
FeishuBuildNotifyAction补上maxAttempts/retryDelay并透传给FeishuNotifyAction。此前这两个参数只存在于FeishuNotifyAction上,而所有 流水线用的都是FeishuBuildNotifyAction,等于够不着,只能吃默认值
0.1.2 #
♻️ Refactoring #
FeishuNotifyAction去掉 curl 自带的--retry:它会与外层重试相乘(3×3=9 次 请求、最坏约 2.5 分钟),且内部重试静默、日志上看不出试了几次。改为只保留 外层重试,请求数降到 3 次、最坏约 51 秒,每次失败都有明确日志
0.1.1 #
✨ Features #
FeishuNotifyAction大幅加固:新增maxAttempts/retryDelay参数,curl 补上-sS -f --connect-timeout 5 --max-time 15 --retry 2 --retry-connrefused, 并解析响应体识别飞书的「HTTP 200 + 非零 code」业务错误;webhook 为空时跳过。 明确保证永不抛异常,通知失败不影响已产出的构建产物
🐛 Bug Fixes #
pipeline_context_test不再写死版本号,改为校验 semver 形态(0.0.4 → 0.1.0 时曾误报失败)
0.1.0 (5c0cac1) #
✨ Features #
PgyerUploadV2Action新增maxRetries参数 (900d7c3)GooglePlayUploadAction/AppStoreUploadAction新增maxRetries参数 (00bc0a1)
📚 Documentation #
- README 新增 SVG hero、执行摘要与终端截图,嵌入 3 张截图并补充 status badges (#5, #6, #7, #8)
- 用户文档移至
doc/,开发计划移至dev-docs/(84a2a6d)
🔧 Chores #
- pubspec 补充
homepage/issue_tracker字段,版本对齐为 0.1.0 (5c0cac1)
0.0.7 (ba11c51) #
♻️ Refactoring #
ShellRunner新增setLogger方法,支持延迟 Logger 注入;各 action 在run()开头调用_shellRunner.setLogger(context.logger),ShellRunnerImpl不再要求构造时传入 Logger (ba11c51)
0.0.6 (57ab3ed) #
✨ Features #
GooglePlayUploadAction新增可选File? artifact参数,支持并行上传时显式指定 AAB 文件 (57ab3ed)AppStoreUploadAction新增可选File? artifact参数,支持并行上传时显式指定 IPA 文件 (57ab3ed)
0.0.5 (3bb3c82) #
⚠️ Breaking Changes #
PipelineAction.run()不再有泛型返回值R,统一返回Future<void>;action 间结果改走PipelineContextKV bag (3bb3c82)Logger从静态类改为实例类,支持verbose/noColor/indent,需注入使用 (d5acc13)buildNumber/buildArtifact迁移到PipelineContextKV bag (413f212,9abbc02)- Pgyer 的
description重命名为buildUpdateDescription,对齐 API 参数名 (e73df8a)
✨ Features #
PipelineContext新增 KV bag(put/get/tryGet)与ContextKeys(66fd5d9)- 接入
--verbose与--no-colorCLI 参数 (754c3c7) PipelineAction新增descriptiongetter,默认取 CamelCase 类名 (6f71068)
♻️ Refactoring #
- Pgyer 通过
resultKey把下载 URL 写入 bag,FeishuBuildNotify读取downloadUrlKeys(c5d43e0) PipelineContext.logger贯穿各 action,Pipeline增加section/closeSection(c8d67a3)- 向
ShellRunnerImpl/GitManagerImpl/VersionManagerImpl注入Logger(f7a0905,6111dd8) - 移除
runStep,日志内联到Pipeline._runTracked(f12b2c3) - 移除 Logger 输出缩进 (
4a5204f)
🐛 Bug Fixes #
- 为
GitManagerImpl单例和延迟的VersionManageraction 注入Logger(4d6d5d0)
📚 Documentation #
- KV bag 结果通道、多 key 下载 URL、日志改进的 spec 与实现计划 (
8825efa,6d0b109,cf4fa8f,b527077,e1fd33a)
0.0.4 (77fad57) #
0.0.3 (5537664) #
Bug Fixes #
- remove hardcoded secrets, redact logs, use HTTPS, harden shell execution
- Replace hardcoded Pgyer API key and Feishu webhook URL with env var reads
- Redact sensitive args (
_api_key,password,secret,token) in shell command logs - Move Pgyer API key from URL query param to POST form body
- Mask App Store API key ID in log output
- Use HTTPS instead of HTTP for Pgyer V2 API calls
- Disable
runInShellto prevent shell metacharacter injection - Use
Directory.systemTemp.createTempSync()for secure temp file creation
0.0.2 (48c8bde) #
Breaking Changes #
PipelineContext.buildNumberis no longer alate intfield. UseresolveBuildVersion()to set it; accessing before resolution throwsStateErrorwith a descriptive message.BuildAndroidActionandBuildIOSActionnow returnvoidinstead ofFile. The build artifact is stored incontext.buildArtifact.PgyerUploadAction,PgyerUploadV2Action,GooglePlayUploadAction, andAppStoreUploadActionno longer accept anartifactconstructor parameter. They read fromcontext.buildArtifactinstead.DefaultShellRunnerrenamed toShellRunnerImpl.DefaultGitManagerrenamed toGitManagerImpl.DefaultVersionManagerrenamed toVersionManagerImpl.
Added #
PipelineContext.buildArtifact/setBuildArtifact()for passing build artifacts between actions.BuildVersionsealed type for type-safe build number state tracking.- Dartdoc comments on all public API surfaces.
0.0.1 (edecffb) #
- Initial release: Logger, ShellRunner, GitManager, VersionManager, BuildMetadata, DeployService, EnvBuilder (abstract), CIToolsConfig.