Skip to content

Commit 2c6d7a6

Browse files
committed
🔖 v0.0.1
1 parent 647cef8 commit 2c6d7a6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

release.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Change directory to the script's directory
2+
cd "$(dirname $0)"
3+
4+
# Get version from theme.json
5+
version=v$(grep -oP '(?<="version": ")[^"]+' plugin.json)
6+
7+
# Commit changes
8+
git add .
9+
git commit -m "🔖 $version"
10+
git push
11+
12+
# 判断 tag 是否存在
13+
if git rev-parse --quiet --verify $version >/dev/null; then
14+
# 删除本地仓库中的 tag
15+
git tag -d $version
16+
# 删除远程仓库中的 tag
17+
git push origin ":refs/tags/$version"
18+
19+
fi
20+
21+
# 创建新的 tag
22+
git tag $version # Create a tag
23+
24+
# 推送新的 tag 到远程仓库
25+
git push origin --tags
26+
# git archive --format zip --output ../package-$version.zip HEAD # Create a zip archive
27+
28+
29+

0 commit comments

Comments
 (0)