2019-01-04 22:12:43 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eE
|
|
|
|
set -o pipefail
|
|
|
|
set -x
|
|
|
|
|
|
|
|
version=`git describe --abbrev=4 --dirty --always --tags`
|
|
|
|
|
|
|
|
f() {
|
|
|
|
make cleanfast; CGO_DISABLED=1 make
|
|
|
|
if [[ $GOOS == darwin ]]; then
|
2019-02-12 21:31:03 +03:00
|
|
|
rm -f dist/AdGuardHome_"$version"_MacOS.zip
|
2019-01-25 22:12:48 +03:00
|
|
|
zip dist/AdGuardHome_"$version"_MacOS.zip AdGuardHome README.md LICENSE.txt
|
2019-01-04 22:12:43 +03:00
|
|
|
elif [[ $GOOS == windows ]]; then
|
2019-02-12 21:31:03 +03:00
|
|
|
rm -f dist/AdGuardHome_"$version"_Windows.zip
|
2019-01-25 22:12:48 +03:00
|
|
|
zip dist/AdGuardHome_"$version"_Windows.zip AdGuardHome.exe README.md LICENSE.txt
|
2019-01-04 22:12:43 +03:00
|
|
|
else
|
2019-02-18 21:13:58 +03:00
|
|
|
rm -rf dist/AdguardHome
|
|
|
|
mkdir -p dist/AdGuardHome
|
|
|
|
cp -pv {AdGuardHome,LICENSE.txt,README.md} dist/AdGuardHome/
|
|
|
|
pushd dist
|
|
|
|
tar zcvf AdGuardHome_"$version"_"$GOOS"_"$GOARCH".tar.gz AdGuardHome/{AdGuardHome,LICENSE.txt,README.md}
|
2019-02-12 21:31:03 +03:00
|
|
|
popd
|
2019-02-18 21:13:58 +03:00
|
|
|
rm -rf dist/AdguardHome
|
2019-01-04 22:12:43 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-02-25 19:04:41 +03:00
|
|
|
# Clean dist and build
|
|
|
|
make clean
|
|
|
|
rm -rf dist
|
|
|
|
|
2019-01-25 22:12:48 +03:00
|
|
|
# Prepare the dist folder
|
|
|
|
mkdir -p dist
|
|
|
|
|
|
|
|
# Prepare releases
|
2019-01-04 22:12:43 +03:00
|
|
|
GOOS=darwin GOARCH=amd64 f
|
|
|
|
GOOS=linux GOARCH=amd64 f
|
|
|
|
GOOS=linux GOARCH=386 f
|
|
|
|
GOOS=linux GOARCH=arm GOARM=6 f
|
|
|
|
GOOS=linux GOARCH=arm64 GOARM=6 f
|
2019-01-25 22:12:48 +03:00
|
|
|
GOOS=windows GOARCH=amd64 f
|