This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
commit.sh
executable file
·67 lines (52 loc) · 1.5 KB
/
commit.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
rev="Release"
#-----
shopt -s extglob
echo $'\e[1m'"Grabbing version..."$'\e[0m'
make clean build || exit 1
ver="$(./clibasic --version | grep "version" | sed 's/.* version //;s/ [(].*//')"
echo "[$ver]"
echo $'\e[1m'"Cleaning..."$'\e[0m'
make clean || exit 1
make cross clean || exit 1
echo $'\e[1m'"Testing..."$'\e[0m'
./build.sh || exit 1
echo $'\e[1m'"Committing and releasing [3 sec to cancel]..."$'\e[0m'
sleep 3s
echo $'\e[1m'"Updating docs submodule..."$'\e[0m'
cd docs/
git add *
git commit -S -m "Updated docs to $ver"
git push
cd ..
echo $'\e[1m'"Updating examples submodule..."$'\e[0m'
cd examples/
git add *
git commit -S -m "Updated examples to $ver"
git push
cd ..
echo $'\e[1m'"Adding files..."$'\e[0m'
mv lib .lib
echo LICENSE Makefile *.c *.h *.sh *.md .gitmodules .gitattributes */
git add LICENSE Makefile *.c *.h *.sh *.md .gitmodules .gitattributes */
e=$?
mv .lib lib
[ $e -ne 0 ] && exit 1
echo $'\e[1m'"Committing..."$'\e[0m'
msg="$ver"
extmsg="$(cat .changelog)"
echo $'\e[1m'"Message:"$'\e[0m'" $msg"
echo $'\e[1mExtended message:\e[0m\n-----\n'"$extmsg"$'\n-----'
git commit -S -m "$msg" -m "$extmsg" || exit 1
echo $'\e[1m'"Packaging..."$'\e[0m'
./package.sh || exit 1
echo $'\e[1m'"Pushing..."$'\e[0m'
git push
echo $'\e[1m'"Making tag..."$'\e[0m'
git tag -s "$ver" -m "$extmsg"
echo $'\e[1m'"Making release..."$'\e[0m'
gh release create "$ver" --title "$rev $ver" --notes "$(./release-text.sh)" *.zip
echo $'\e[1m'"Updating AUR packages..."$'\e[0m'
cd .aur/
./update.sh "$ver"
cd ..