2019-01-26 14:24:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2019-03-27 20:50:25 +00:00
|
|
|
# test locally
|
|
|
|
TESTDIR=build_test
|
|
|
|
rm -rf "$TESTDIR"
|
|
|
|
# run client tests with ASAN enabled
|
|
|
|
meson "$TESTDIR" -Db_sanitize=address
|
|
|
|
ninja -C"$TESTDIR" test
|
|
|
|
|
2019-03-27 20:51:42 +00:00
|
|
|
# test server
|
|
|
|
GRADLE=${GRADLE:-./gradlew}
|
|
|
|
$GRADLE -p server check
|
|
|
|
|
2019-01-26 14:24:37 +00:00
|
|
|
BUILDDIR=build_release
|
|
|
|
rm -rf "$BUILDDIR"
|
|
|
|
meson "$BUILDDIR" --buildtype release --strip -Db_lto=true
|
|
|
|
cd "$BUILDDIR"
|
|
|
|
ninja
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# build Windows releases
|
|
|
|
make -f Makefile.CrossWindows
|
|
|
|
|
|
|
|
# the generated server must be the same everywhere
|
2019-10-30 22:40:10 +00:00
|
|
|
cmp "$BUILDDIR/server/scrcpy-server" dist/scrcpy-win32/scrcpy-server
|
|
|
|
cmp "$BUILDDIR/server/scrcpy-server" dist/scrcpy-win64/scrcpy-server
|
2019-01-26 14:24:37 +00:00
|
|
|
|
|
|
|
# get version name
|
|
|
|
TAG=$(git describe --tags --always)
|
|
|
|
|
|
|
|
# create release directory
|
|
|
|
mkdir -p "release-$TAG"
|
2019-10-30 22:40:10 +00:00
|
|
|
cp "$BUILDDIR/server/scrcpy-server" "release-$TAG/scrcpy-server-$TAG"
|
2019-01-26 14:24:37 +00:00
|
|
|
cp "dist/scrcpy-win32-$TAG.zip" "release-$TAG/"
|
|
|
|
cp "dist/scrcpy-win64-$TAG.zip" "release-$TAG/"
|
|
|
|
|
|
|
|
# generate checksums
|
|
|
|
cd "release-$TAG"
|
2019-10-30 22:40:10 +00:00
|
|
|
sha256sum "scrcpy-server-$TAG" \
|
2019-01-26 14:24:37 +00:00
|
|
|
"scrcpy-win32-$TAG.zip" \
|
|
|
|
"scrcpy-win64-$TAG.zip" > SHA256SUMS.txt
|
|
|
|
|
|
|
|
echo "Release generated in release-$TAG/"
|