2020-05-14 12:37:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
|
|
|
version="0.0.0"
|
|
|
|
else
|
|
|
|
version="$1"
|
|
|
|
fi
|
|
|
|
|
2020-05-25 18:02:19 +00:00
|
|
|
version_safe=${version//\./_}
|
|
|
|
|
2020-05-14 12:37:06 +00:00
|
|
|
echo "Creating ${version} release"
|
|
|
|
|
|
|
|
rm -rf build/linux*
|
2020-05-26 16:58:17 +00:00
|
|
|
rm -rf build/macosx*
|
2020-05-14 12:37:06 +00:00
|
|
|
rm -rf build/windows*
|
|
|
|
|
2020-05-23 10:03:45 +00:00
|
|
|
mkdir -p build/release
|
2020-05-14 12:37:06 +00:00
|
|
|
|
2020-05-14 12:45:40 +00:00
|
|
|
go generate ../cmd/tins2020
|
|
|
|
|
2020-05-23 10:03:45 +00:00
|
|
|
mkdir -p build/linux
|
2020-05-14 12:37:06 +00:00
|
|
|
go build -tags static -ldflags "-s -w" -o build/linux/botanim ../cmd/tins2020
|
|
|
|
cp ../README.md build/linux
|
2020-05-23 10:03:45 +00:00
|
|
|
cd build/linux
|
2020-05-25 18:02:19 +00:00
|
|
|
zip -9 -q ../release/botanim_${version_safe}_linux_amd64.zip *
|
|
|
|
echo "Created Linux release: build/release/botanim_${version_safe}_linux_amd64.zip"
|
2020-05-23 10:03:45 +00:00
|
|
|
cd ../..
|
2020-05-14 12:37:06 +00:00
|
|
|
|
2020-05-23 10:03:45 +00:00
|
|
|
mkdir -p build/linux-allegro
|
|
|
|
go build -tags static,allegro -ldflags "-s -w" -o build/linux-allegro/botanim ../cmd/tins2020
|
|
|
|
cp ../README.md build/linux-allegro
|
|
|
|
cd build/linux-allegro
|
2020-05-25 18:02:19 +00:00
|
|
|
zip -9 -q ../release/botanim_allegro_${version_safe}_linux_amd64.zip *
|
|
|
|
echo "Created Linux (Allegro) release: build/release/botanim_allegro_${version_safe}_linux_amd64.zip"
|
2020-05-23 10:03:45 +00:00
|
|
|
cd ../..
|
|
|
|
|
2020-05-26 16:58:17 +00:00
|
|
|
mkdir -p build/macosx
|
|
|
|
CGO_ENABLED=1 CC=o64-clang CXX=o64-clang++ GOOS=darwin GOARCH=amd64 go build -tags static -ldflags "-s -w" -o build/macosx/botanim ../cmd/tins2020
|
|
|
|
cp ../README.md build/macosx
|
|
|
|
cd build/macosx
|
|
|
|
zip -9 -q ../release/botanim_${version_safe}_macosx_amd64.zip *
|
|
|
|
echo "Created Mac OS X release: build/release/botanim_${version_safe}_macosx_amd64.zip"
|
|
|
|
cd ../..
|
|
|
|
|
2020-05-23 10:03:45 +00:00
|
|
|
mkdir -p build/windows
|
|
|
|
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -tags static -ldflags "-s -w" -o build/windows/botanim.exe ../cmd/tins2020
|
|
|
|
cp ../README.md build/windows
|
|
|
|
cd build/windows
|
2020-05-25 18:02:19 +00:00
|
|
|
zip -9 -q ../release/botanim_${version_safe}_windows_amd64.zip *
|
|
|
|
echo "Created Windows release: build/release/botanim_${version_safe}_windows_amd64.zip"
|
2020-05-23 10:03:45 +00:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
mkdir -p build/windows-allegro
|
|
|
|
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -tags static,allegro,mingw64_7_3 -ldflags "-s -w" -o build/windows-allegro/botanim.exe ../cmd/tins2020
|
|
|
|
cp ../README.md build/windows-allegro
|
|
|
|
cd build/windows-allegro
|
2020-05-25 18:02:19 +00:00
|
|
|
zip -9 -q ../release/botanim_allegro_${version_safe}_windows_amd64.zip *
|
|
|
|
echo "Created Windows (Allegro) release: build/release/botanim_allegro_${version_safe}_windows_amd64.zip"
|
2020-05-23 10:03:45 +00:00
|
|
|
cd ../..
|