forked from felixngd/Unity.Pooling
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
45 lines (37 loc) · 834 Bytes
/
deploy.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
#!/bin/sh -ex
if test $# -eq 0
then
set -- -h
fi
OPTS_SPEC="\
deploy.sh --semver <semver>\n\
--\n\
s,semver Semantic versioning: 1.2.0, 1.2.0-preview.1\n\
h,help https://semver.org/
"
while [[ "$#" -gt 0 ]]; do
case $1 in
-s|--semver)
SEMVER="$2";
shift
;;
-h|--help)
echo -e "$OPTS_SPEC";
exit 0
;;
*)
echo "Unknown parameter passed: $1";
exit 1
;;
esac
shift
done
[ -z "$SEMVER" ] && echo "You must provide the --semver option." && exit 1
PREFIX="Packages/ZBase.Foundation.Pooling"
BRANCH="upm"
git subtree split --prefix="$PREFIX" --branch $BRANCH
git tag $SEMVER $BRANCH
git push origin $BRANCH --tags
git push origin --delete $BRANCH
git branch -D $BRANCH
exit 0