File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1
1
vendor
2
2
pkg
3
3
bin
4
+ dist
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # build binary distributions for linux/amd64 and darwin/amd64
4
+ set -e
5
+
6
+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
7
+ echo " working dir $DIR "
8
+
9
+ rm -rf $DIR /vendor
10
+ echo " ... refreshing vendor directory"
11
+ ./vendor.sh
12
+
13
+ echo " ... running tests"
14
+ gb test || exit 1
15
+
16
+ arch=$( go env GOARCH)
17
+ version=$( cat $DIR /src/cmd/git-open-pull/version.go | grep " const Version" | awk ' {print $NF}' | sed ' s/"//g' )
18
+ goversion=$( go version | awk ' {print $3}' )
19
+
20
+ mkdir -p dist
21
+ for os in linux darwin; do
22
+ echo " ... building v$version for $os /$arch "
23
+ BUILD=$( mktemp -d -t git-open-pull)
24
+ TARGET=" git-open-pull-$version .$os -$arch .$goversion "
25
+ GOOS=$os GOARCH=$arch CGO_ENABLED=0 gb build
26
+ mkdir -p $BUILD /$TARGET
27
+ cp bin/git-open-pull-$os -$arch $BUILD /$TARGET /git-open-pull
28
+ pushd $BUILD > /dev/null
29
+ tar czvf $TARGET .tar.gz $TARGET
30
+ if [ -e $DIR /dist/$TARGET .tar.gz ]; then
31
+ echo " ... WARNING overwriting dist/$TARGET .tar.gz"
32
+ fi
33
+ mv $TARGET .tar.gz $DIR /dist
34
+ echo " ... built dist/$TARGET .tar.gz"
35
+ popd > /dev/null
36
+ done
You can’t perform that action at this time.
0 commit comments