Skip to content

Commit 35ae836

Browse files
committed
ci: only supports official and beta versions
1 parent 6492726 commit 35ae836

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: .github/workflows/relese.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ jobs:
2828
- name: Install dependencies
2929
run: npm install
3030

31-
# 获取 tag 的版本类型(alpha 或 beta
31+
# 获取 tag 的版本类型(仅支持 正式版和beta版
3232
- name: Determine release tag
3333
id: determine_tag
3434
run: |
3535
TAG=$(echo "${GITHUB_REF}" | sed 's/refs\/tags\/\(.*\)/\1/')
36-
PRERELEASE=$(echo $TAG | sed -n 's/.*-\(alpha\|beta\|rc\).*/\1/p')
37-
if [ -n "$PRERELEASE" ]; then
38-
echo "::set-output name=tag::$PRERELEASE"
39-
else
36+
if [[ "$TAG" =~ -beta ]]; then
37+
echo "::set-output name=tag::beta"
38+
elif [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
4039
echo "::set-output name=tag::latest"
40+
else
41+
echo "Unsupported version detected. Terminating."
42+
exit 1
4143
fi
4244
# # 打包
4345
# - name: Build Packages

0 commit comments

Comments
 (0)