forked from Simple2B/BeamSuntory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion
executable file
·53 lines (42 loc) · 1.04 KB
/
version
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
#!/bin/bash
# script to update the version number in the site
# Ensure that the user has provided a valid argument
case $1 in
patch)
;;
minor)
;;
major)
;;
*)
echo "Usage: $0 [patch|minor|major]"
VERSION=$(node -p "require('./package.json').version")
echo "Current version: $VERSION"
exit 1
;;
esac
# Ensure that the working directory is clean
if [[ $(git status -s) ]]
then
echo "Working directory is not clean! Please commit all changes before running this script."
exit 1
fi
# Ensure that the local branch is up to date with the remote branch
git pull
# goto script directory
cd "$(dirname "$0")"
# build front-end
yarn install
yarn build
# increment front-end version
npm version $1 --no-git-tag-version
if [ $? -ne 0 ]; then
exit 1
fi
# get current package version
VERSION=$(node -p "require('./package.json').version")
# update poetry version
poetry version $VERSION
git commit -am v${VERSION}
git tag -a -m v${VERSION} v${VERSION}
git push --follow-tags