Build script

This commit is contained in:
Jakob Borg
2013-12-22 00:16:49 +01:00
parent 7d235a454d
commit 8e65d36691
3 changed files with 25 additions and 4 deletions

16
build.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
version=$(git describe --always)
for goos in darwin linux freebsd ; do
for goarch in amd64 386 ; do
export GOOS="$goos"
export GOARCH="$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"
done
done