Files
MyGoNavi/tools/should-force-global-driver-builds.sh
Syngnat 36a80951a0 🐛 fix(ci/driver): 修复驱动发布错配与 dev 驱动下载命中旧资产
- 发布链路新增 driver release 资产自检,校验已发布二进制与 manifest revision/sha256 一致
- dev-build 与 release 工作流在复用已发布驱动前先校验实际资产,发现旧二进制混入时强制全量重建
- driver manifest 新增 sha256 字段,避免仅凭 source commit 与 manifest 一致就误判发布有效
- 驱动变更检测与全量重建判定纳入 release asset 校验脚本变更,确保链路修复提交会触发自愈重建
- 驱动下载优先使用 GitHub release asset API 地址,并对资产接口按 octet-stream 下载,降低 dev-latest 同名资产命中旧缓存的风险
- 保持 DuckDB 无主键编辑修复不回退,并通过 internal/db 与前端相关回归测试
2026-06-05 20:00:27 +08:00

85 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$SCRIPT_DIR"
usage() {
cat <<'EOF'
用法:
./tools/should-force-global-driver-builds.sh --base <ref> --head <ref>
输出:
true 表示本次变更涉及 driver 构建/发布链路,平台构建阶段必须保留全局驱动重建结果
false 表示可继续按平台 revision diff 缩小重建范围
EOF
}
base_ref=""
head_ref=""
while [[ $# -gt 0 ]]; do
case "$1" in
--base)
base_ref="${2:-}"
shift 2
;;
--head)
head_ref="${2:-}"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "未知参数:$1" >&2
usage >&2
exit 1
;;
esac
done
if [[ -z "$base_ref" || -z "$head_ref" ]]; then
usage >&2
exit 1
fi
if [[ "$base_ref" == "all" ]]; then
echo "true"
exit 0
fi
if ! git rev-parse --verify "${base_ref}^{commit}" >/dev/null 2>&1; then
echo "无法解析 base ref$base_ref" >&2
exit 1
fi
if ! git rev-parse --verify "${head_ref}^{commit}" >/dev/null 2>&1; then
echo "无法解析 head ref$head_ref" >&2
exit 1
fi
while IFS= read -r file; do
case "$file" in
.github/workflows/dev-build.yml|\
.github/workflows/release.yml|\
build-driver-agents.sh|\
tools/compress-driver-artifact.sh|\
tools/detect-changed-driver-agents.sh|\
tools/diff-driver-agent-revisions.sh|\
tools/package-driver-release-assets.py|\
tools/generate-driver-release-manifest.py|\
tools/validate-driver-release-assets.py|\
tools/complete-driver-release-assets.py|\
tools/resolve-driver-release-source.py|\
tools/validate-driver-release-manifest.sh|\
tools/should-force-global-driver-builds.sh)
echo "true"
exit 0
;;
esac
done < <(git diff --name-only "$base_ref" "$head_ref")
echo "false"