-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupgrade.sh
42 lines (34 loc) · 1.25 KB
/
upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 版本升级
version=2.1.3
# 以下不动
template=$(cat << EOF
package org.dromara.autotable.core.constants;
public interface Version {
String VALUE = "${version}";
}
EOF
)
echo "开始替换Version.java的版本号:${version}"
# 替换 org.dromara.autotable.core.constants.Version 的版本号
echo ${template} > ./auto-table-core/src/main/java/org/dromara/autotable/core/constants/Version.java
echo "开始替换pom.xml的版本号:${version}"
mvn versions:set -DnewVersion=${version}
echo "开始commit到本地仓库:${version}"
git commit -am "版本升级:${version}"
tagName=v${version}
echo "开始打tag:${tagName}"
git rev-parse --verify ${tagName} >/dev/null 2>&1
if [ $? -eq 0 ]; then
git tag -d ${tagName}
echo "本地标签${tagName}已删除"
fi
if git ls-remote --tags | grep -q "refs/tags/${tagName}"; then
git push origin --delete ${tagName}
echo "远程标签${tagName}已删除"
fi
echo "新建标签:${tagName}"
git tag -a ${tagName} -m "版本号:${version}"
echo "开始提交到远程git仓库:${version}"
git push origin main --tags
echo "开始发布新的版本到maven仓库:${version}"
mvn clean deploy -pl auto-table-annotation,auto-table-core,auto-table-spring-boot-starter,auto-table-solon-plugin -am