Skip to content

Commit 112d05d

Browse files
committed
chore(release): Stop updating README during releases
Remove README from release-managed files so release version bumps only update package metadata, changelog, and server manifest. Keep docs CLI command validation visible during releases, but allow release notes to warn on historical command references instead of blocking the release.
1 parent 77a73cc commit 112d05d

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

scripts/check-docs-cli-commands.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,23 @@ function findInvalidCommands(files, validPairs, validWorkflows) {
164164
}
165165

166166
function main() {
167+
const warnOnly = process.argv.includes('--warn-only');
167168
const catalog = loadToolCatalog();
168169
const files = getConsumerDocs();
169170
const { validPairs, validWorkflows } = buildValidationSets(catalog);
170171
const findings = findInvalidCommands(files, validPairs, validWorkflows);
171172

172173
if (findings.length > 0) {
173-
fail(
174-
'Found invalid CLI command references in consumer docs.',
175-
`${findings.join('\n')}\n\nRun \`node build/cli.js tools\` to inspect valid commands.`,
176-
);
174+
const detail = `${findings.join('\n')}\n\nRun \`node build/cli.js tools\` to inspect valid commands.`;
175+
176+
if (warnOnly) {
177+
console.warn('\n⚠️ Found invalid CLI command references in consumer docs.');
178+
console.warn(detail);
179+
console.warn('\nContinuing because --warn-only was supplied.');
180+
return;
181+
}
182+
183+
fail('Found invalid CLI command references in consumer docs.', detail);
177184
}
178185

179186
console.log('✅ Docs CLI command check passed (README.md + CHANGELOG.md).');

scripts/release.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ RELEASE_MANAGED_FILES=(
329329
"CHANGELOG.md"
330330
"package.json"
331331
"package-lock.json"
332-
"README.md"
333332
"server.json"
334333
)
335334

@@ -396,6 +395,13 @@ if [[ -n "$CHANGELOG_VALIDATION_TEMP" ]]; then
396395
fi
397396
echo "✅ CHANGELOG entry found and release notes generated."
398397

398+
# Release notes can intentionally include historical CLI commands in migration examples.
399+
# Keep the consumer-docs check visible during release, but treat those findings as warnings here.
400+
echo ""
401+
echo "🧾 Checking docs CLI command references (warnings only for release notes)..."
402+
node scripts/check-docs-cli-commands.js --warn-only
403+
echo "ℹ️ Docs CLI command warning check completed."
404+
399405
# Check if package.json already has this version (from previous attempt)
400406
CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")
401407
if [[ "$CURRENT_PACKAGE_VERSION" == "$VERSION" ]]; then
@@ -422,18 +428,6 @@ if [[ "$SKIP_VERSION_UPDATE" == "false" ]]; then
422428
echo "🔧 Setting version to $VERSION..."
423429
run npm version "$VERSION" --no-git-tag-version
424430

425-
# README update
426-
echo ""
427-
echo "📝 Updating install tags in README.md..."
428-
README_AT_TAG_REGEX='xcodebuildmcp@([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?|latest|beta|alpha)'
429-
README_URLENCODED_AT_TAG_REGEX='xcodebuildmcp%40([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?|latest|beta|alpha)'
430-
run sed_inplace "s/${README_AT_TAG_REGEX}/xcodebuildmcp@${NPM_TAG}/g" README.md
431-
run sed_inplace "s/${README_URLENCODED_AT_TAG_REGEX}/xcodebuildmcp%40${NPM_TAG}/g" README.md
432-
433-
echo "📝 Updating Cursor install link config in README.md..."
434-
CURSOR_INSTALL_CONFIG=$(node -e "const tag='${NPM_TAG}';const config=JSON.stringify({command:\`npx -y xcodebuildmcp@\${tag} mcp\`});console.log(encodeURIComponent(Buffer.from(config).toString('base64')));")
435-
run node -e "const fs=require('fs');const path='README.md';const next='config=${CURSOR_INSTALL_CONFIG}';const contents=fs.readFileSync(path,'utf8');const updated=contents.replace(/config=[^)\\s]+/g,next);fs.writeFileSync(path,updated);"
436-
437431
# server.json update
438432
echo ""
439433
if [[ -f server.json ]]; then
@@ -447,9 +441,9 @@ if [[ "$SKIP_VERSION_UPDATE" == "false" ]]; then
447441
echo ""
448442
echo "📦 Committing version changes..."
449443
if [[ -f server.json ]]; then
450-
run git add package.json package-lock.json README.md CHANGELOG.md server.json
444+
run git add package.json package-lock.json CHANGELOG.md server.json
451445
else
452-
run git add package.json package-lock.json README.md CHANGELOG.md
446+
run git add package.json package-lock.json CHANGELOG.md
453447
fi
454448
run git commit -m "Release v$VERSION"
455449
else

0 commit comments

Comments
 (0)