Skip to content

Commit 07f3623

Browse files
author
dompling
committed
fix
1 parent 3f21389 commit 07f3623

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,19 @@ jobs:
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

0 commit comments

Comments
 (0)