@@ -296,22 +296,34 @@ else
296296fi
297297
298298if [[ " $SKIP_VERSION_UPDATE " == " false" ]]; then
299+ NPM_TAG=" latest"
300+ if [[ " $VERSION " == * " -" * ]]; then
301+ PRERELEASE_TAG=" ${VERSION#* -} "
302+ PRERELEASE_LABEL=" ${PRERELEASE_TAG%% .* } "
303+ if [[ " $PRERELEASE_LABEL " == " alpha" ]]; then
304+ NPM_TAG=" alpha"
305+ elif [[ " $PRERELEASE_LABEL " == " beta" ]]; then
306+ NPM_TAG=" beta"
307+ fi
308+ fi
309+
299310 # Version update
300311 echo " "
301312 echo " 🔧 Setting version to $VERSION ..."
302313 run npm version " $VERSION " --no-git-tag-version
303314
304315 # README update
305316 echo " "
306- echo " 📝 Updating version in README.md..."
307- # Update version references in code examples using extended regex for precise semver matching
308- README_AT_SEMVER_REGEX=' @[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?(-[a-zA-Z0-9]+\.[0-9]+)*(-[a-zA-Z0-9]+)?'
309- run sed_inplace " s/${README_AT_SEMVER_REGEX} /@${VERSION} /g" README.md
310-
311- # Update URL-encoded version references in shield links
312- echo " 📝 Updating version in README.md shield links..."
313- README_URLENCODED_NPM_AT_SEMVER_REGEX=' npm%3Axcodebuildmcp%40[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?(-[a-zA-Z0-9]+\.[0-9]+)*(-[a-zA-Z0-9]+)?'
314- run sed_inplace " s/${README_URLENCODED_NPM_AT_SEMVER_REGEX} /npm%3Axcodebuildmcp%40${VERSION} /g" README.md
317+ echo " 📝 Updating install tags in README.md and docs/GETTING_STARTED.md..."
318+ README_AT_TAG_REGEX=' xcodebuildmcp@([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?|latest|beta|alpha)'
319+ README_URLENCODED_AT_TAG_REGEX=' xcodebuildmcp%40([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?|latest|beta|alpha)'
320+ run sed_inplace " s/${README_AT_TAG_REGEX} /xcodebuildmcp@${NPM_TAG} /g" README.md
321+ run sed_inplace " s/${README_AT_TAG_REGEX} /xcodebuildmcp@${NPM_TAG} /g" docs/GETTING_STARTED.md
322+ run sed_inplace " s/${README_URLENCODED_AT_TAG_REGEX} /xcodebuildmcp%40${NPM_TAG} /g" README.md
323+
324+ echo " 📝 Updating Cursor install link config in README.md..."
325+ 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')));" )
326+ 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);"
315327
316328 # Update skill installer URL and versioned ref in README.md
317329 echo " 📝 Updating skill installer URL in README.md..."
0 commit comments