Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 14 additions & 30 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,21 @@ jobs:
if: steps.release-type.outputs.should_publish == 'true'
id: check-npm-version
run: |
SHARED_VERSION=$(node -p "require('./packages/shared/package.json').version")
CORE_VERSION=$(node -p "require('./packages/core/package.json').version")

echo "Checking shared package version: $SHARED_VERSION"
echo "Checking core package version: $CORE_VERSION"

# 检查 shared 包是否已存在
if npm view @dadigua/hyperchat-shared@$SHARED_VERSION version >/dev/null 2>&1; then
echo "shared_exists=true" >> $GITHUB_OUTPUT
echo "❌ @dadigua/hyperchat-shared@$SHARED_VERSION already exists on npm"
else
echo "shared_exists=false" >> $GITHUB_OUTPUT
echo "✅ @dadigua/hyperchat-shared@$SHARED_VERSION does not exist on npm"
fi
PACKAGE_VERSION=$(node -p "require('./package.json').version")

# 检查 core 包是否已存在
if npm view @dadigua/hyperchat@$CORE_VERSION version >/dev/null 2>&1; then
echo "core_exists=true" >> $GITHUB_OUTPUT
echo "❌ @dadigua/hyperchat@$CORE_VERSION already exists on npm"
else
echo "core_exists=false" >> $GITHUB_OUTPUT
echo "✅ @dadigua/hyperchat@$CORE_VERSION does not exist on npm"
fi
echo "Checking package version: $PACKAGE_VERSION"

# 如果任一包已存在,则跳过发布
if [[ $(npm view @dadigua/hyperchat-shared@$SHARED_VERSION version >/dev/null 2>&1 && echo "true" || echo "false") == "true" ]] || [[ $(npm view @dadigua/hyperchat@$CORE_VERSION version >/dev/null 2>&1 && echo "true" || echo "false") == "true" ]]; then
# 检查包是否已存在
if npm view @dadigua/hyperchat@$PACKAGE_VERSION version >/dev/null 2>&1; then
echo "package_exists=true" >> $GITHUB_OUTPUT
echo "❌ @dadigua/hyperchat@$PACKAGE_VERSION already exists on npm"
echo "should_skip=true" >> $GITHUB_OUTPUT
echo "🚫 Skipping publish - one or more packages already exist on npm"
echo "🚫 Skipping publish - package already exists on npm"
else
echo "package_exists=false" >> $GITHUB_OUTPUT
echo "✅ @dadigua/hyperchat@$PACKAGE_VERSION does not exist on npm"
echo "should_skip=false" >> $GITHUB_OUTPUT
echo "🚀 All packages are ready for publishing"
echo "🚀 Package is ready for publishing"
fi

# 显示跳过发布的消息
Expand All @@ -151,10 +135,10 @@ jobs:
echo "🚫 发布已跳过:当前版本已存在于 npm 上"
echo "如需强制发布,请先更新版本号"

# 发布所有包到 npm
- name: Publish all packages to npm
# 发布包到 npm
- name: Publish package to npm
if: steps.release-type.outputs.should_publish == 'true' && steps.check-npm-version.outputs.should_skip == 'false'
run: npm run publish:all
run: npm run publish:core
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NPM_PUBLISH_TAG: ${{ steps.release-type.outputs.publish_tag }}
Expand Down Expand Up @@ -183,7 +167,7 @@ jobs:
📄 <b>修改的文件:</b>
<code>${{ steps.files.outputs.changed }}</code>

✅ <b>状态:</b> 包已成功发布到 npm(版本通过 pre-push 钩子自动管理)
✅ <b>状态:</b> @dadigua/hyperchat 已成功发布到 npm
🔗 <b>详情链接:</b> ${{ steps.details.outputs.url }}
⏰ <b>时间:</b> ${{ github.event.head_commit.timestamp || github.event.workflow_run.updated_at }}

Expand Down
13 changes: 0 additions & 13 deletions .hyperchat/mcp.json

This file was deleted.

28 changes: 0 additions & 28 deletions .hyperchat/settings.jsonc

This file was deleted.

206 changes: 0 additions & 206 deletions .hyperchat/settings.schema.json

This file was deleted.

Loading
Loading