-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·48 lines (37 loc) · 1.33 KB
/
build.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
#!/usr/bin/env bash
VERSION=$VERSION
REPO=https://github.com/statping/statping/releases/download
rm -rf build
mkdir build
BINFILE=statping-darwin-amd64.tar.gz
curl -o build/$BINFILE -OL $REPO/v$VERSION/$BINFILE
OSX64=`openssl dgst -sha256 build/$BINFILE | sed 's/^.*= //'`
printf "$BINFILE ===> $OSX64\n"
BINFILE=statping-darwin-386.tar.gz
curl -o build/$BINFILE -OL $REPO/v$VERSION/$BINFILE
OSX32=`openssl dgst -sha256 build/$BINFILE | sed 's/^.*= //'`
printf "$BINFILE ===> $OSX32\n"
BINFILE=statping-linux-amd64.tar.gz
curl -o build/$BINFILE -OL $REPO/v$VERSION/$BINFILE
LIN64=`openssl dgst -sha256 build/$BINFILE | sed 's/^.*= //'`
printf "$BINFILE ===> $LIN64\n"
BINFILE=statping-linux-386.tar.gz
curl -o build/$BINFILE -OL $REPO/v$VERSION/$BINFILE
LIN32=`openssl dgst -sha256 build/$BINFILE | sed 's/^.*= //'`
printf "$BINFILE ===> $LIN32\n"
cat formula | \
sed -e "s/\$VERSION/$VERSION/" \
-e "s/\$OSX64/$OSX64/" \
-e "s/\$OSX32/$OSX32/" \
-e "s/\$LIN64/$LIN64/" \
-e "s/\$LIN32/$LIN32/" \
> statping.rb
cat statping.rb
rev=$(git rev-parse --short HEAD)
git config user.name $GH_USER
git config user.email $GH_EMAIL
git remote rm origin
git remote add origin https://$GH_USER:[email protected]/statping/homebrew-statping.git
git add statping.rb
git commit -m "New Homebrew v$VERSION ${rev}"
git push origin HEAD:master