-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake_build.sh
More file actions
executable file
·26 lines (18 loc) · 926 Bytes
/
Copy pathmake_build.sh
File metadata and controls
executable file
·26 lines (18 loc) · 926 Bytes
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
#!/bin/bash
if [ $(git status -s | wc -l) -gt 0 ]; then
echo "You have uncommitted changes. Please commit or stash your changes before continuing"
exit
fi
CURRENT_VERSION=$(grep \"version\" package.json | awk -F'"' '{print $4}')
read -p "What version (current is ${CURRENT_VERSION})? " NEXT_VERSION
echo "Please write some release notes for v${NEXT_VERSION}..."
echo -e "### v${NEXT_VERSION}\nDate: $(date +%Y-%m-%d)\n[Release](https://github.com/mike-douglas/tsm-editor/releases/tag/v${NEXT_VERSION})\n\nNOTES\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
${EDITOR} ./CHANGELOG.md
echo "Building v${NEXT_VERSION}..."
perl -pi -e "s/\"version\": \"${CURRENT_VERSION}\"/\"version\": \"${NEXT_VERSION}\"/" package.json && \
yarn build && \
git st && \
git add ./ && \
git commit -a -m "Releasing v${NEXT_VERSION}" && \
git tag v${NEXT_VERSION}
echo "Done. Now you can run git push --tags origin master to deploy"