forked from michenriksen/aquatone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·31 lines (24 loc) · 770 Bytes
/
release.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
#!/bin/bash
CURRENT_VERSION=$(cat core/banner.go | grep Version | cut -d '"' -f 2)
TO_UPDATE=(
core/banner.go
)
read -p "[?] Did you remember to update CHANGELOG.md? "
read -p "[?] Did you remember to update README.md with new features/changes? "
echo -n "[*] Current version is $CURRENT_VERSION. Enter new version: "
read NEW_VERSION
echo "[*] Pushing and tagging version $NEW_VERSION in 5 seconds..."
sleep 5
for file in "${TO_UPDATE[@]}"
do
echo "[*] Patching $file ..."
sed -i".bak" "s/$CURRENT_VERSION/$NEW_VERSION/g" $file
rm core/banner.go.bak
git add $file
done
git commit -m "Releasing v$NEW_VERSION"
git push
git tag -a v$NEW_VERSION -m "Release v$NEW_VERSION"
git push origin v$NEW_VERSION
echo
echo "[*] All done, v$NEW_VERSION released."