2018-08-26 00:44:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e # fail on any error
|
|
|
|
set -u # treat unset variables as error
|
2018-10-02 01:03:58 +02:00
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "__________Show ENVIROMENT__________"
|
2018-10-02 01:03:58 +02:00
|
|
|
echo "CI_SERVER_NAME: " $CI_SERVER_NAME
|
|
|
|
echo "CARGO_HOME: " $CARGO_HOME
|
|
|
|
echo "CARGO_TARGET: " $CARGO_TARGET
|
|
|
|
echo "CC: " $CC
|
|
|
|
echo "CXX: " $CXX
|
2019-01-18 12:03:18 +01:00
|
|
|
#strip ON
|
|
|
|
export RUSTFLAGS=" -C link-arg=-s"
|
2018-08-26 00:44:08 +02:00
|
|
|
|
2019-01-15 17:27:43 +01:00
|
|
|
echo "_____ Building target: "$CARGO_TARGET" _____"
|
2018-11-06 20:26:05 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
2019-01-15 17:27:43 +01:00
|
|
|
# only thing we need for android
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p parity-clib --features final
|
2018-11-06 20:26:05 +01:00
|
|
|
else
|
2019-01-15 17:27:43 +01:00
|
|
|
time cargo build --target $CARGO_TARGET --release --features final
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p evmbin
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p ethstore-cli
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p ethkey-cli
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p whisper-cli
|
2018-11-06 20:26:05 +01:00
|
|
|
fi
|
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Post-processing binaries _____"
|
|
|
|
rm -rf artifacts
|
|
|
|
mkdir -p artifacts
|
|
|
|
cd artifacts
|
|
|
|
mkdir -p $CARGO_TARGET
|
|
|
|
cd $CARGO_TARGET
|
2019-01-15 17:27:43 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
|
|
|
# only thing we need for android
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so
|
|
|
|
else
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity ./parity
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper
|
|
|
|
fi
|
2018-11-06 20:26:05 +01:00
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Calculating checksums _____"
|
|
|
|
for binary in $(ls)
|
|
|
|
do
|
|
|
|
rhash --sha256 $binary -o $binary.sha256
|
2018-11-06 20:26:05 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
|
|
|
echo "> ${binary} cannot be hashed with cross-compiled binary"
|
|
|
|
else
|
|
|
|
./parity tools hash $binary > $binary.sha3
|
|
|
|
fi
|
2018-08-26 00:44:08 +02:00
|
|
|
done
|
2018-11-06 20:26:05 +01:00
|
|
|
|