-
Notifications
You must be signed in to change notification settings - Fork 12
/
prepare-release.sh
executable file
·42 lines (33 loc) · 1.03 KB
/
prepare-release.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
#!/bin/sh
set -e
set pipefail
die() {
echo "$@" >&2
exit 1
}
[ -z "$YOJ_VERSION" ] && die "Please set YOJ_VERSION before calling prepare-release.sh!"
(echo "$YOJ_VERSION" | grep -- '-SNAPSHOT' >/dev/null) && die "Please set YOJ_VERSION to a release version (x.y.z)!"
[ -z "$MVN" ] && MVN='mvn'
echo "[**] Updating YOJ artifact version to ${YOJ_VERSION}..."
"$MVN" versions:set -DnewVersion="${YOJ_VERSION}" -DprocessAllModules -DgenerateBackupPoms=false
echo
echo "[**] Checking that YOJ ${YOJ_VERSION} builds successfully:"
"$MVN" clean verify
echo
echo "[**] Updating README.md:"
sed "/<artifactId>yoj-bom<\/artifactId>\$/ {
N
s|<version>.*</version>|<version>${YOJ_VERSION}</version>|
}" README.md > README.md.new
mv -- README.md.new README.md
echo
echo "[**] Committing changes to VCS:"
git add -A
git commit -m "Release YOJ ${YOJ_VERSION}"
git tag "v${YOJ_VERSION}"
echo
echo "[**] Pushing changes:"
git push origin && git push origin --tags
echo
echo "[**] Done!"
echo " See https://github.com/ydb-platform/yoj-project/actions"