mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-27 17:52:18 +00:00
eea478b9dc
Add a script to generate the whole release properly. It first builds locally in release mode, then execute tests. Then it builds archives for Windows. Finally, it puts all release files (Windows archives, prebuilt server and checksums) in a separate release directory.
36 lines
934 B
Bash
Executable File
36 lines
934 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# build and test locally
|
|
BUILDDIR=build_release
|
|
rm -rf "$BUILDDIR"
|
|
meson "$BUILDDIR" --buildtype release --strip -Db_lto=true
|
|
cd "$BUILDDIR"
|
|
ninja
|
|
ninja test
|
|
cd -
|
|
|
|
# build Windows releases
|
|
make -f Makefile.CrossWindows
|
|
|
|
# the generated server must be the same everywhere
|
|
cmp "$BUILDDIR/server/scrcpy-server.jar" dist/scrcpy-win32/scrcpy-server.jar
|
|
cmp "$BUILDDIR/server/scrcpy-server.jar" dist/scrcpy-win64/scrcpy-server.jar
|
|
|
|
# get version name
|
|
TAG=$(git describe --tags --always)
|
|
|
|
# create release directory
|
|
mkdir -p "release-$TAG"
|
|
cp "$BUILDDIR/server/scrcpy-server.jar" "release-$TAG/scrcpy-server-$TAG.jar"
|
|
cp "dist/scrcpy-win32-$TAG.zip" "release-$TAG/"
|
|
cp "dist/scrcpy-win64-$TAG.zip" "release-$TAG/"
|
|
|
|
# generate checksums
|
|
cd "release-$TAG"
|
|
sha256sum "scrcpy-server-$TAG.jar" \
|
|
"scrcpy-win32-$TAG.zip" \
|
|
"scrcpy-win64-$TAG.zip" > SHA256SUMS.txt
|
|
|
|
echo "Release generated in release-$TAG/"
|