File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 5151 python3 TrollScript-Private/scripts/generate_api_docs.py TrollScript-Private/JSModulesAPI/en ./API.en.md
5252 echo "✅ Generated API.md and API.en.md"
5353
54- # Generate NPM Package
54+ # Generate NPM Package with auto-incrementing version
5555 mkdir -p npm
56- PACKAGE_VERSION="1.0.${{ github.run_number }}"
56+
57+ # 获取当前 NPM 包的最新版本
58+ CURRENT_VERSION=$(npm view @dompling/trollscript-types version 2>/dev/null || echo "1.0.0")
59+ echo "📋 Current NPM version: $CURRENT_VERSION"
60+
61+ # 提取 patch 版本号并递增
62+ PATCH_VERSION=$(echo $CURRENT_VERSION | cut -d. -f3)
63+ NEW_PATCH=$((PATCH_VERSION + 1))
64+ PACKAGE_VERSION="1.0.$NEW_PATCH"
65+ echo "📋 New version: $PACKAGE_VERSION"
66+
5767 python3 TrollScript-Private/scripts/generate_npm_package.py TrollScript-Private/JSModulesAPI/zh ./npm $PACKAGE_VERSION
5868 echo "✅ Generated NPM package (v$PACKAGE_VERSION) in npm/"
5969 else
You can’t perform that action at this time.
0 commit comments