fix(ci): check-version.sh 兼容预发布 tag (v0.6.0-rc1 / beta / alpha)
- 预发布标签在比较时也剥离 -rc1 / -beta.2 / -alpha.3 等后缀 - 允许用户复用已发布的版本文件来打预发布 - 显式不匹配仍正常工作
This commit is contained in:
1 parent
19f58c3a2b
commit
ce8501cf06
1 file changed
+5
@@ -16,6 +16,11 @@ fi
|
||||
|
||||
# Strip leading 'v' for comparison (we expect semver without v)
|
||||
EXPECTED_BARE="${EXPECTED#v}"
|
||||
# Strip common prerelease suffixes (-rc1, -beta.2, -alpha.3, etc.) so a
|
||||
# v0.6.0-rc1 tag can reuse the existing 0.6.0 versions in the project files.
|
||||
# If the project does want a separate prerelease version, it must be
|
||||
# committed explicitly to the three version files.
|
||||
EXPECTED_BARE="${EXPECTED_BARE%%-*}"
|
||||
|
||||
PKG_VERSION=$(node -p "require('./package.json').version")
|
||||
CARGO_VERSION=$(grep -E '^version\s*=' src-tauri/Cargo.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
|
||||
Reference in new issue
Block a user