Skip to content

Commit 4460020

Browse files
committed
fix: ci build issue
1 parent 92d9f87 commit 4460020

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/publish-mcp.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ jobs:
9999
if [ "$CURRENT_VERSION" = "$VERSION" ]; then
100100
echo "✓ packages/mcp-server/package.json already at version $VERSION"
101101
else
102-
npm version $VERSION --no-git-tag-version
102+
# Update version directly without npm to avoid monorepo workspace resolution
103+
node -e "
104+
const fs = require('fs');
105+
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
106+
pkg.version = '$VERSION';
107+
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
108+
"
103109
echo "✓ packages/mcp-server/package.json updated to version $VERSION"
104110
fi
105111
@@ -147,11 +153,30 @@ jobs:
147153
- name: Publish to NPM
148154
run: |
149155
VERSION="${{ github.event.inputs.version }}"
150-
cd packages/mcp-server
156+
157+
# Copy mcp-server to temp directory to isolate from monorepo
158+
TEMP_DIR=$(mktemp -d)
159+
echo "Creating isolated publish directory: $TEMP_DIR"
160+
161+
cp -r packages/mcp-server/dist "$TEMP_DIR/"
162+
cp packages/mcp-server/README.md "$TEMP_DIR/"
163+
164+
# Copy package.json and remove prepublishOnly script (build already done)
165+
node -e "
166+
const fs = require('fs');
167+
const pkg = JSON.parse(fs.readFileSync('packages/mcp-server/package.json', 'utf8'));
168+
delete pkg.scripts.prepublishOnly;
169+
fs.writeFileSync('$TEMP_DIR/package.json', JSON.stringify(pkg, null, 2) + '\n');
170+
"
171+
172+
cd "$TEMP_DIR"
173+
echo "Publishing from: $(pwd)"
174+
ls -la
175+
151176
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
152177
echo "🔍 DRY RUN: Testing NPM publish..."
153178
npm publish --dry-run --access public
154-
echo "✓ Dry run completed - package would be published to NPM registry"
179+
echo "✓ Dry run completed successfully"
155180
else
156181
echo "Publishing to NPM with provenance..."
157182
npm publish --provenance --access public

packages/mcp-server/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)