Browse Source

Update release script

importviewkey
Duke Leto 4 years ago
parent
commit
da8fef9f5a
  1. 129
      src/scripts/mkrelease.sh

129
src/scripts/mkrelease.sh

@ -7,39 +7,39 @@ fi
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi
if [ -z $ZCASH_DIR ]; then
echo "ZCASH_DIR is not set. Please set it to the base directory of a Zcash project with built Zcash binaries."
if [ -z $HUSH_DIR ]; then
echo "HUSH_DIR is not set. Please set it to the base directory of a Zcash project with built Zcash binaries."
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcashd ]; then
echo "Couldn't find zcashd in $ZCASH_DIR/artifacts/. Please build zcashd."
if [ ! -f $HUSH_DIR/artifacts/komodod ]; then
echo "Couldn't find komodod in $HUSH_DIR/artifacts/. Please build komodod."
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli ]; then
echo "Couldn't find zcash-cli in $ZCASH_DIR/artifacts/. Please build zcashd."
if [ ! -f $HUSH_DIR/artifacts/hush-cli ]; then
echo "Couldn't find hush-cli in $HUSH_DIR/artifacts/. Please build komodod."
exit 1;
fi
# Ensure that zcashd is the right build
echo -n "zcashd version........."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd && ! readelf -s $ZCASH_DIR/artifacts/zcashd | grep -q "GLIBC_2\.25"; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build or zcashd is built with libc 2.25"
exit 1
fi
echo -n "zcashd.exe version....."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd.exe; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build"
exit 1
fi
# Ensure that komodod is the right build
#echo -n "komodod version........."
#if grep -q "zqwMagicBean" $HUSH_DIR/artifacts/komodod && ! readelf -s $HUSH_DIR/artifacts/komodod | grep -q "GLIBC_2\.25"; then
# echo "[OK]"
#else
# echo "[ERROR]"
## echo "komodod doesn't seem to be a zqwMagicBean build or komodod is built with libc 2.25"
# exit 1
#fi
#echo -n "komodod.exe version....."
#if grep -q "zqwMagicBean" $HUSH_DIR/artifacts/komodod.exe; then
# echo "[OK]"
#else
# echo "[ERROR]"
# echo "komodod doesn't seem to be a zqwMagicBean build"
# exit 1
#fi
echo -n "Version files.........."
# Replace the version number in the .pro file so it gets picked up everywhere
@ -65,16 +65,15 @@ echo "[OK]"
echo -n "Building..............."
rm -rf bin/zec-qt-wallet* > /dev/null
rm -rf bin/zecwallet* > /dev/null
rm -rf bin/silentdragon* > /dev/null
make clean > /dev/null
make -j$(nproc) > /dev/null
./build.sh > /dev/null
echo "[OK]"
# Test for Qt
echo -n "Static link............"
if [[ $(ldd zecwallet | grep -i "Qt") ]]; then
if [[ $(ldd silentdragon | grep -i "Qt") ]]; then
echo "FOUND QT; ABORT";
exit 1
fi
@ -82,27 +81,31 @@ echo "[OK]"
echo -n "Packaging.............."
mkdir bin/zecwallet-v$APP_VERSION > /dev/null
strip zecwallet
cp zecwallet bin/zecwallet-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcashd bin/zecwallet-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcash-cli bin/zecwallet-v$APP_VERSION > /dev/null
cp README.md bin/zecwallet-v$APP_VERSION > /dev/null
cp LICENSE bin/zecwallet-v$APP_VERSION > /dev/null
cd bin && tar czf linux-zecwallet-v$APP_VERSION.tar.gz zecwallet-v$APP_VERSION/ > /dev/null
mkdir bin/silentdragon-v$APP_VERSION > /dev/null
strip silentdragon
cp silentdragon bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodod bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodo-cli bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodo-tx bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hushd bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hush-cli bin/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hush-tx bin/silentdragon-v$APP_VERSION > /dev/null
cp README.md bin/silentdragon-v$APP_VERSION > /dev/null
cp LICENSE bin/silentdragon-v$APP_VERSION > /dev/null
cd bin && tar czf linux-silentdragon-v$APP_VERSION.tar.gz silentdragon-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp bin/linux-zecwallet-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz
cp bin/linux-silentdragon-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz
echo "[OK]"
if [ -f artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz ] ; then
if [ -f artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz ] ; then
echo -n "Package contents......."
# Test if the package is built OK
if tar tf "artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz" | wc -l | grep -q "6"; then
if tar tf "artifacts/linux-binaries-silentdragon-v$APP_VERSION.tar.gz" | wc -l | grep -q "6"; then
echo "[OK]"
else
echo "[ERROR]"
@ -114,24 +117,25 @@ else
fi
echo -n "Building deb..........."
debdir=bin/deb/zecwallet-v$APP_VERSION
debdir=bin/deb/silentdragon-v$APP_VERSION
mkdir -p $debdir > /dev/null
mkdir $debdir/DEBIAN
mkdir -p $debdir/usr/local/bin
cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control
cp zecwallet $debdir/usr/local/bin/
cp $ZCASH_DIR/artifacts/zcashd $debdir/usr/local/bin/zqw-zcashd
cp silentdragon $debdir/usr/local/bin/
# TODO: how does this interact with hushd deb ?
cp $HUSH_DIR/artifacts/komodod $debdir/usr/local/bin/hush-komodod
mkdir -p $debdir/usr/share/pixmaps/
cp res/zecwallet.xpm $debdir/usr/share/pixmaps/
cp res/silentdragon.xpm $debdir/usr/share/pixmaps/
mkdir -p $debdir/usr/share/applications
cp src/scripts/desktopentry $debdir/usr/share/applications/zec-qt-wallet.desktop
cp src/scripts/desktopentry $debdir/usr/share/applications/silentdragon.desktop
dpkg-deb --build $debdir >/dev/null
cp $debdir.deb artifacts/linux-deb-zecwallet-v$APP_VERSION.deb
cp $debdir.deb artifacts/linux-deb-silentdragon-v$APP_VERSION.deb
echo "[OK]"
@ -145,14 +149,14 @@ if [ -z $MXE_PATH ]; then
exit 0;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcashd.exe ]; then
echo "Couldn't find zcashd.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
if [ ! -f $HUSH_DIR/artifacts/komodod.exe ]; then
echo "Couldn't find komodod.exe in $HUSH_DIR/artifacts/. Please build komodod.exe"
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli.exe ]; then
echo "Couldn't find zcash-cli.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
if [ ! -f $HUSH_DIR/artifacts/komodo-cli.exe ]; then
echo "Couldn't find komodo-cli.exe in $HUSH_DIR/artifacts/. Please build komodod-cli.exe"
exit 1;
fi
@ -168,28 +172,31 @@ echo "[OK]"
echo -n "Building..............."
# TODO: where is this .pro file?
x86_64-w64-mingw32.static-qmake-qt5 zec-qt-wallet-mingw.pro CONFIG+=release > /dev/null
make -j32 > /dev/null
echo "[OK]"
echo -n "Packaging.............."
mkdir release/zecwallet-v$APP_VERSION
cp release/zecwallet.exe release/zecwallet-v$APP_VERSION
cp $ZCASH_DIR/artifacts/zcashd.exe release/zecwallet-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcash-cli.exe release/zecwallet-v$APP_VERSION > /dev/null
cp README.md release/zecwallet-v$APP_VERSION
cp LICENSE release/zecwallet-v$APP_VERSION
cd release && zip -r Windows-binaries-zecwallet-v$APP_VERSION.zip zecwallet-v$APP_VERSION/ > /dev/null
mkdir release/silentdragon-v$APP_VERSION
cp release/silentdragon.exe release/silentdragon-v$APP_VERSION
cp $HUSH_DIR/artifacts/komodod.exe release/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/komodo-cli.exe release/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hushd.bat release/silentdragon-v$APP_VERSION > /dev/null
cp $HUSH_DIR/artifacts/hush-cli.bat release/silentdragon-v$APP_VERSION > /dev/null
cp README.md release/silentdragon-v$APP_VERSION
cp LICENSE release/silentdragon-v$APP_VERSION
cd release && zip -r Windows-binaries-silentdragon-v$APP_VERSION.zip silentdragon-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp release/Windows-binaries-zecwallet-v$APP_VERSION.zip ./artifacts/
cp release/Windows-binaries-silentdragon-v$APP_VERSION.zip ./artifacts/
echo "[OK]"
if [ -f artifacts/Windows-binaries-zecwallet-v$APP_VERSION.zip ] ; then
if [ -f artifacts/Windows-binaries-silentdragon-v$APP_VERSION.zip ] ; then
echo -n "Package contents......."
if unzip -l "artifacts/Windows-binaries-zecwallet-v$APP_VERSION.zip" | wc -l | grep -q "11"; then
if unzip -l "artifacts/Windows-binaries-silentdragon-v$APP_VERSION.zip" | wc -l | grep -q "11"; then
echo "[OK]"
else
echo "[ERROR]"

Loading…
Cancel
Save