Build artefacts in build dir

This commit is contained in:
Jakob Borg 2013-12-30 09:02:18 -05:00
parent 976baff44f
commit 001a6724ec
2 changed files with 9 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
syncthing
*.tar.gz
build

View File

@ -3,17 +3,20 @@
version=$(git describe --always)
go test ./... || exit 1
mkdir -p build || exit 1
for goos in darwin linux freebsd ; do
for goarch in amd64 386 ; do
echo "$goos-$goarch"
export GOOS="$goos"
export GOARCH="$goarch"
export name="syncthing-$goos-$goarch"
go build -ldflags "-X main.Version $version" \
&& mkdir -p "syncthing-$goos-$goarch" \
&& mv syncthing "syncthing-$goos-$goarch" \
&& cp syncthing.ini "syncthing-$goos-$goarch" \
&& tar zcf "syncthing-$goos-$goarch.tar.gz" "syncthing-$goos-$goarch" \
&& rm -r "syncthing-$goos-$goarch"
&& mkdir -p "$name" \
&& mv syncthing "$name" \
&& cp syncthing.ini "$name" \
&& tar zcf "$name.tar.gz" "$name" \
&& rm -r "$name" \
&& mv "$name.tar.gz" build
done
done