-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrelease-engineering.sh
More file actions
executable file
·74 lines (53 loc) · 1.45 KB
/
release-engineering.sh
File metadata and controls
executable file
·74 lines (53 loc) · 1.45 KB
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
67
68
69
70
71
72
73
74
#! /bin/bash
VERSION=$1
# commit & push
FILE=`pwd`/`git rev-parse --show-cdup`/noahstrap
sed -i "" "s/our \$VERSION.*/our \$VERSION = \"$VERSION\";/" $FILE
git add $FILE
while true; do
read -p "commit and push? (type 'd' to show the changes) [y/n/d]" answer
case $answer in
"y") break;;
"n") exit 1;;
"d") git diff --cached
esac
done
git commit -m "version $VERSION"
git push origin master
git tag $VERSION
git push origin --tags
echo successfully pushed noahstrap $VERSION
# publish homebrew
URL=https://github.com/linux-noah/noahstrap/archive/$VERSION.tar.gz
echo url: $URL
curl -LO $URL
SHA256=`shasum -a 256 $VERSION.tar.gz | cut -d ' ' -f 1`
rm $VERSION.tar.gz
echo sha256: $SHA256
if [[ -d homebrew-noah ]]; then
cd homebrew-noah
git reset --hard
git pull
else
git clone git@github.com:linux-noah/homebrew-noah.git
cd homebrew-noah
fi
sed -i "" -e "8 s@.*@ url \"$URL\"@g" noahstrap.rb
sed -i "" -e "9 s@.*@ version \"$VERSION\"@g" noahstrap.rb
sed -i "" -e "10 s@.*@ sha256 \"$SHA256\"@g" noahstrap.rb
git add noahstrap.rb
git commit -m "noahstrap $VERSION"
git push origin master
cd ..
rm -rf homebrew-noah
echo successfully published noahstrap $VERSION
while true; do
read -p "upgrade noahstrap on your system? [y/n]" answer
case $answer in
"y") break;;
"n") exit 0;;
esac
done
brew update
brew upgrade noahstrap
echo successfully upgraded noahstrap on your system