feat(release): show agent version changes

This commit is contained in:
t8y2
2026-07-22 10:51:44 +08:00
parent 9e53fe28f8
commit 68e7169f1d
3 changed files with 75 additions and 4 deletions
+16 -2
View File
@@ -14,14 +14,18 @@ function bumpPatchVersion(version) {
function pathChanged(changedFiles, pathPrefix) {
const normalized = pathPrefix.endsWith("/") ? pathPrefix : `${pathPrefix}/`;
return changedFiles.some((file) => file === pathPrefix || file.startsWith(normalized));
return changedFiles.some((file) => (file === pathPrefix || file.startsWith(normalized)) && isAgentPublishRelevantFile(file));
}
export function isAgentPublishRelevantFile(file) {
return !file.endsWith("_test.go") && !file.includes("/src/test/") && !file.includes("/bench/");
}
function isCommonRuntimeChange(file) {
return file === "agents/common/build.gradle" || file.startsWith("agents/common/src/main/");
}
function parseLegacyStandaloneProjects(buildGradle) {
export function parseLegacyStandaloneProjects(buildGradle) {
const match = /legacyStandaloneProjects\s*=\s*\[([^\]]*)\]/m.exec(buildGradle);
if (!match) return new Set();
@@ -128,6 +132,16 @@ export function evaluateAgentVersionBump({
return { changed, versions: nextVersions, prevVersions, logs };
}
export function getAgentVersionChanges(previousVersions, nextVersions) {
return Object.keys(nextVersions)
.filter((moduleName) => nextVersions[moduleName] !== previousVersions[moduleName])
.map((moduleName) => ({
moduleName,
previousVersion: previousVersions[moduleName] ?? null,
nextVersion: nextVersions[moduleName],
}));
}
function git(args) {
return execFileSync("git", args, { encoding: "utf8" }).trim();
}