Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ jobs:
return 0
fi

if grep -Eiq 'cannot publish over the previously published versions|previously published versions' "$publish_log"; then
echo "${package_name}@${package_version} was already published according to npm, skipping"
rm -f "$publish_log"
return 0
fi

if version_exists "$package_name" "$package_version"; then
echo "${package_name}@${package_version} already exists on npm after publish attempt, skipping"
rm -f "$publish_log"
Expand Down Expand Up @@ -489,17 +495,28 @@ jobs:
exit 0
fi

if (cd cli && pnpm publish --access public --no-git-checks); then
publish_log=$(mktemp)

if (cd cli && pnpm publish --access public --no-git-checks) 2>&1 | tee "$publish_log"; then
verify_version_exists
rm -f "$publish_log"
exit 0
fi

if grep -Eiq 'cannot publish over the previously published versions|previously published versions' "$publish_log"; then
echo "${package_name}@${package_version} was already published according to npm, skipping"
rm -f "$publish_log"
exit 0
fi

if version_exists; then
echo "${package_name}@${package_version} already exists on npm after publish attempt, skipping"
rm -f "$publish_log"
exit 0
fi

echo "::error::Failed to publish ${package_name}@${package_version}. Exact version is still missing from npm."
rm -f "$publish_log"
exit 1

# 4.5. CLI 可用后,发布 MCP 包到 npm
Expand Down Expand Up @@ -586,17 +603,28 @@ jobs:
exit 0
fi

if (cd mcp && pnpm publish --access public --no-git-checks); then
publish_log=$(mktemp)

if (cd mcp && pnpm publish --access public --no-git-checks) 2>&1 | tee "$publish_log"; then
verify_version_exists
rm -f "$publish_log"
exit 0
fi

if grep -Eiq 'cannot publish over the previously published versions|previously published versions' "$publish_log"; then
echo "${package_name}@${package_version} was already published according to npm, skipping"
rm -f "$publish_log"
exit 0
fi

if version_exists; then
echo "${package_name}@${package_version} already exists on npm after publish attempt, skipping"
rm -f "$publish_log"
exit 0
fi

echo "::error::Failed to publish ${package_name}@${package_version}. Exact version is still missing from npm."
rm -f "$publish_log"
exit 1

# 5. 构建 CLI 独立二进制(仅 artifact,不发 Release)
Expand Down
Loading