forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-version.sh
executable file
·51 lines (43 loc) · 1.43 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
#!/bin/bash
DOCS_VERSION_COMMAND="run version"
echo "Select an option for release:"
echo
select VERSION in patch minor major "Specific Version"
do
echo
if [[ $REPLY =~ ^[1-4]$ ]]; then
if [[ $REPLY == 4 ]]; then
read -p "Enter a specific version: " -r VERSION
echo
if [[ -z $REPLY ]]; then
VERSION=$REPLY
fi
fi
read -p "Create $VERSION commit - Are you sure ... (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ || -z $REPLY ]]; then
# Bump version
CURRENT_VERSION=$(node -p "require('./package.json').version")
yarn version --new-version $VERSION --no-git-tag-version
NEW_VERSION=$(node -p "require('./package.json').version")
cd docs/guide/website && yarn && yarn $DOCS_VERSION_COMMAND $NEW_VERSION && cd ../../..
# Update changelog from git history
yarn cmd changelog
V=$CURRENT_VERSION node build/remove_changelog_dupes.js
node build/update_pkg_version.js
# Create commit
git add -A
git commit -m "v$NEW_VERSION"
git tag -a "v$NEW_VERSION" -m "created tag v$NEW_VERSION"
echo "-----"
echo "Finished, commit created, need to push to origin/master directly"
else
echo Cancelled
fi
break
else
echo Invalid \"${REPLY}\"
echo "To continue, please enter one of the options (1-4):"
echo
fi
done