syncthing/build.sh

20 lines
521 B
Bash
Raw Normal View History

2013-12-21 23:16:49 +00:00
#!/bin/bash
version=$(git describe --always)
2013-12-22 22:13:51 +00:00
go test ./... || exit 1
2013-12-21 23:16:49 +00:00
for goos in darwin linux freebsd ; do
for goarch in amd64 386 ; do
2013-12-22 22:13:51 +00:00
echo "$goos-$goarch"
2013-12-21 23:16:49 +00:00
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