SuperAPI AI 工具集

homebrew-publish

测试与质量

查看项目

更新于 10-15 22:38

技能介绍

用途:创建或更新 Homebrew tap 与 formula,让用户可通过 brew install OWNER/tap/<formula> 安装项目的 CLI/TUI。

主要能力:确认 GitHub owner、tap 名称与仓库是否存在;收集项目仓库 URL、发布 tag/版本、源码 tarball 或预编译资源 URL;识别构建系统与语言(Go、Rust、Node/TypeScript、Python 等);定义二进制名与最小测试 do 命令;确认目标平台/架构及是否需要 bottles。

使用方式:若 tap 仓库不存在,运行 brew tap-new OWNER/homebrew-tap(或 homebrew-<tapname>),再用 gh repo create OWNER/homebrew-tap --push --public --source "$(brew --repository OWNER/homebrew-tap)" 创建。生成骨架用 brew create <url-to-tarball> --tap OWNER/homebrew-tap --set-name <formula>。随后编辑 Formula/<formula>.rb,按语言模板(references/formula-go.md、formula-rust.md、formula-node.md、formula-python.md、formula-prebuilt.md)接入 build/install/test,确保 desc、homepage、url、sha256、license 正确。计算 sha256:本地文件用 shasum -a 256 <file>,远程 URL 用 curl -L <url> | shasum -a 256。本地测试:brew install --build-from-source OWNER/tap/<formula>、brew test OWNER/tap/<formula>,可选 brew audit --strict --online OWNER/tap/<formula>。最后在 tap 仓库提交并推送。新版本发布时更新 url、sha256(必要时 version),重跑测试后提交推送。

限制与注意:优先使用源码构建,除非必须使用预编译二进制;若启用 bottles,保留 brew tap-new 生成的默认 workflows 并按其发布说明操作。资料未提供具体收费、价格或平台支持范围等信息。