From 36a8839a6a4c60d50125fc62197ba63f1642c1d5 Mon Sep 17 00:00:00 2001 From: Michael Dailey Date: Tue, 12 May 2026 16:44:40 -0500 Subject: [PATCH] PDX-000: fix(ci): make npm publish idempotent and wait for registry propagation before MCP publish RCA: MCP registry publish failed with 404 because npm package was not yet indexed when mcp-publisher ran immediately after npm publish. Fix: Skip npm publish if version already exists on npm, and poll npm registry for up to 3 minutes before running mcp-publisher publish. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/DeployManual.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/DeployManual.yml b/.github/workflows/DeployManual.yml index 1d83ec7..8fe8456 100644 --- a/.github/workflows/DeployManual.yml +++ b/.github/workflows/DeployManual.yml @@ -33,10 +33,31 @@ jobs: cat /home/runner/work/_temp/.npmrc cat $NPM_CONFIG_USERCONFIG - name: Publish package on NPM - run: npm publish --tag "$TAG" --access public + run: | + VERSION=$(node -p "require('./package.json').version") + STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://registry.npmjs.org/%40provartesting%2Fprovardx-cli/${VERSION}") + if [ "$STATUS" = "200" ]; then + echo "Version ${VERSION} already published on npm, skipping." + else + npm publish --tag "$TAG" --access public + fi env: TAG: ${{ github.event.inputs.tag || 'latest' }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Wait for npm package to be available + run: | + VERSION=$(node -p "require('./package.json').version") + echo "Waiting for @provartesting/provardx-cli@${VERSION} to appear on npm..." + for i in $(seq 1 18); do + STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://registry.npmjs.org/%40provartesting%2Fprovardx-cli/${VERSION}") + if [ "$STATUS" = "200" ]; then + echo "Package is available (attempt ${i})." + exit 0 + fi + echo "Attempt ${i}/18: npm returned ${STATUS}, retrying in 10s..." + sleep 10 + done + echo "Package not available after 3 minutes; proceeding anyway." - name: Install mcp-publisher run: | curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher