-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-version.sh
63 lines (56 loc) · 1.22 KB
/
release-version.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -ex
if [ -z "$(git status --porcelain)" ]; then
echo "git status OK."
else
git status
set +x
echo
echo "!!!"
echo
echo "WORKING DIRECTORY NOT CLEAN"
echo "PLZ COMMIT CHANGES"
exit 66
fi
export BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
if [ $BRANCH_NAME == "master" ] || [ $BRANCH_NAME == "bos" ]; then
echo "branch ok"
else
echo "plz use master or bos brancch"
exit 1
fi
for TESTFILE in test.sh test-pypi.sh; do
if bash $TESTFILE; then
echo $TESTFILE OK
else
echo $TESTFILE FAIL PLZ FIX BEFORE RELEASE VERSION
exit 1
fi
done
(
cd game
cargo set-version --bump patch
)
export NEW_VERSION="$(cat game/Cargo.toml | grep "^version = .*$" | cut -f3 -d' ' | cut -f2 -d'"' | head -n1 | tr -d '\n' | tr -d ' ')"
if [ "$NEW_VERSION" == "" ]; then
echo "no version given!"
exit 1
fi
echo "$NEW_VERSION" > VERSION
(
cd client
cargo set-version $NEW_VERSION
)
(
cd server
cargo set-version $NEW_VERSION
)
(
cd sparganothis_vim
cargo set-version $NEW_VERSION
)
git add .
git commit -m "bump version: $NEW_VERSION"
git tag -a $NEW_VERSION -m "release $NEW_VERSION"
git push
git push origin $NEW_VERSION