-
Notifications
You must be signed in to change notification settings - Fork 1
/
release
executable file
·27 lines (26 loc) · 985 Bytes
/
release
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
#!/usr/bin/env bash
# takes the tag as an argument (e.g. v0.1.0)
if [ -n "$1" ]; then
if [[ "$1" =~ ^[0-9]{0,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
read -r -p "Are you sure to upgrade to v$1 ? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
# update the version in README.md
sed -i '' -E "s|\"zio-notion\" % \"[0-9].*\"|\"zio-notion\" % \"${1#v}\"|" README.md
# update the version in docs/getting-started.md
sed -i '' -E "s|\"zio-notion\" % \".*\"|\"zio-notion\" % \"${1#v}\"|" docs/intro.md
git add README.md
git add docs/intro.md
git commit -m "chore(release): prepare for v$1"
git tag "v$1"
git push --atomic origin master "v$1"
cd website && npm run deploy
else
echo "Operation canceled"
fi
else
echo "The version should be X.X.X"
fi
else
echo "Please provide a tag"
fi