Skip to content

Commit c9e3843

Browse files
committed
chore: 🤖 调整ci配置
1 parent 5c14283 commit c9e3843

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ jobs:
8080
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
8181
fi
8282
83+
- name: 检查版本是否已存在
84+
id: check_version
85+
run: |
86+
VERSION=${{ steps.get_version.outputs.version }}
87+
PACKAGE_NAME=$(node -p "require('./package.json').name")
88+
89+
# 检查版本是否已在npm上发布
90+
if npm view "$PACKAGE_NAME@$VERSION" version 2>/dev/null; then
91+
echo "❌ 版本 $VERSION 已存在于 npm 上"
92+
echo "请使用新的版本号重新发布"
93+
exit 1
94+
else
95+
echo "✅ 版本 $VERSION 可以发布"
96+
fi
97+
8398
- name: 更新版本号 (手动触发时)
8499
if: github.event_name == 'workflow_dispatch'
85100
run: |

0 commit comments

Comments
 (0)