add missed scripts
This commit is contained in:
parent
ebc6b9cec9
commit
8926b43d49
32
scripts/gitlab/build-unix.sh
Normal file
32
scripts/gitlab/build-unix.sh
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
echo "__________Show ENVIROMENT__________"
|
||||||
|
echo "CC: " $CC
|
||||||
|
echo "CXX: " $CXX
|
||||||
|
|
||||||
|
echo "__________CARGO CONFIG__________"
|
||||||
|
rm -rf .cargo
|
||||||
|
mkdir -p .cargo
|
||||||
|
echo "[target.$CARGO_TARGET]" >> .cargo/config
|
||||||
|
echo "linker= \"$CC\"" >> .cargo/config
|
||||||
|
cat .cargo/config
|
||||||
|
|
||||||
|
echo "_____ Building target: "$CARGO_TARGET" _____"
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "_____ Post-processing binaries _____"
|
||||||
|
rm -rf artifacts
|
||||||
|
mkdir -p artifacts
|
||||||
|
cd artifacts
|
||||||
|
cp ../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey} .
|
||||||
|
strip -v ./*
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
for binary in $(ls)
|
||||||
|
do
|
||||||
|
rhash --sha256 $binary -o $binary.sha256
|
||||||
|
done
|
25
scripts/gitlab/build-windows.sh
Normal file
25
scripts/gitlab/build-windows.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
|
||||||
|
set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"
|
||||||
|
|
||||||
|
rustup default stable-x86_64-pc-windows-msvc
|
||||||
|
echo "_____ Building _____"
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "_____ Post-processing binaries _____"
|
||||||
|
rm -rf artifacts
|
||||||
|
mkdir -p artifacts
|
||||||
|
cd artifacts
|
||||||
|
cp --verbose ../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey}.exe .
|
||||||
|
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
for binary in $(ls)
|
||||||
|
do
|
||||||
|
rhash --sha256 $binary -o $binary.unsigned.sha256
|
||||||
|
done
|
253
scripts/gitlab-build.sh → scripts/gitlab/build.sh
Executable file → Normal file
253
scripts/gitlab-build.sh → scripts/gitlab/build.sh
Executable file → Normal file
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e # fail on any error
|
set -e # fail on any error
|
||||||
set -u # treat unset variables as error
|
|
||||||
#ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier
|
#ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier
|
||||||
BUILD_PLATFORM=$1
|
BUILD_PLATFORM=$1
|
||||||
PLATFORM=$2
|
PLATFORM=$2
|
||||||
@ -20,6 +18,7 @@ echo "Architecture: " $ARC
|
|||||||
echo "Libssl version: " $LIBSSL
|
echo "Libssl version: " $LIBSSL
|
||||||
echo "Parity version: " $VER
|
echo "Parity version: " $VER
|
||||||
echo "Branch: " $CI_BUILD_REF_NAME
|
echo "Branch: " $CI_BUILD_REF_NAME
|
||||||
|
echo "Protect? " $protect
|
||||||
echo "--------------------"
|
echo "--------------------"
|
||||||
|
|
||||||
# NOTE for md5 and sha256 we want to display filename as well
|
# NOTE for md5 and sha256 we want to display filename as well
|
||||||
@ -28,7 +27,7 @@ MD5_BIN="rhash --md5"
|
|||||||
SHA256_BIN="rhash --sha256"
|
SHA256_BIN="rhash --sha256"
|
||||||
|
|
||||||
set_env () {
|
set_env () {
|
||||||
echo "Set ENVIROMENT"
|
echo "__________Set ENVIROMENT__________"
|
||||||
export HOST_CC=gcc
|
export HOST_CC=gcc
|
||||||
export HOST_CXX=g++
|
export HOST_CXX=g++
|
||||||
rm -rf .cargo
|
rm -rf .cargo
|
||||||
@ -48,42 +47,31 @@ set_env_win () {
|
|||||||
echo "@ signtool sign /f "\%"1 /p "\%"2 /tr http://timestamp.comodoca.com /du https://parity.io "\%"3" > sign.cmd
|
echo "@ signtool sign /f "\%"1 /p "\%"2 /tr http://timestamp.comodoca.com /du https://parity.io "\%"3" > sign.cmd
|
||||||
}
|
}
|
||||||
build () {
|
build () {
|
||||||
if [[ "windows" = $IDENT ]]
|
echo "__________Build parity__________"
|
||||||
then
|
time cargo build --target $PLATFORM --features final --release
|
||||||
# This is a nasty hack till we figure out the proper cargo caching strategy
|
echo "__________Build evmbin__________"
|
||||||
echo "Remove index"
|
time cargo build --target $PLATFORM --release -p evmbin
|
||||||
rm -rf cargo/registry/index/*.
|
echo "__________Build ethstore-cli__________"
|
||||||
fi
|
time cargo build --target $PLATFORM --release -p ethstore-cli
|
||||||
echo "Build parity:"
|
echo "__________Build ethkey-cli__________"
|
||||||
cargo build --target $PLATFORM --features final --release
|
time cargo build --target $PLATFORM --release -p ethkey-cli
|
||||||
echo "Build evmbin:"
|
|
||||||
cargo build --target $PLATFORM --release -p evmbin
|
|
||||||
echo "Build ethstore-cli:"
|
|
||||||
cargo build --target $PLATFORM --release -p ethstore-cli
|
|
||||||
echo "Build ethkey-cli:"
|
|
||||||
cargo build --target $PLATFORM --release -p ethkey-cli
|
|
||||||
echo "Build whisper-cli:"
|
|
||||||
cargo build --target $PLATFORM --release -p whisper-cli
|
|
||||||
}
|
}
|
||||||
strip_binaries () {
|
strip_binaries () {
|
||||||
echo "Strip binaries:"
|
echo "__________Strip binaries__________"
|
||||||
$STRIP_BIN -v target/$PLATFORM/release/parity
|
$STRIP_BIN -v target/$PLATFORM/release/parity
|
||||||
$STRIP_BIN -v target/$PLATFORM/release/parity-evm
|
$STRIP_BIN -v target/$PLATFORM/release/parity-evm
|
||||||
$STRIP_BIN -v target/$PLATFORM/release/ethstore
|
$STRIP_BIN -v target/$PLATFORM/release/ethstore
|
||||||
$STRIP_BIN -v target/$PLATFORM/release/ethkey
|
$STRIP_BIN -v target/$PLATFORM/release/ethkey;
|
||||||
$STRIP_BIN -v target/$PLATFORM/release/whisper;
|
|
||||||
}
|
}
|
||||||
calculate_checksums () {
|
calculate_checksums () {
|
||||||
echo "Checksum calculation:"
|
echo "__________Checksum calculation__________"
|
||||||
rhash --version
|
rhash --version
|
||||||
|
|
||||||
rm -rf *.md5
|
rm -rf *.md5
|
||||||
rm -rf *.sha256
|
rm -rf *.sha256
|
||||||
|
|
||||||
BIN="target/$PLATFORM/release/parity$S3WIN"
|
BIN="target/$PLATFORM/release/parity$S3WIN"
|
||||||
export SHA3="$($BIN tools hash $BIN)"
|
export SHA3="$($BIN tools hash $BIN)"
|
||||||
|
echo "__________Parity file SHA3__________"
|
||||||
echo "Parity file SHA3: $SHA3"
|
echo $SHA3
|
||||||
$MD5_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.md5
|
$MD5_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.md5
|
||||||
$SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256
|
$SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256
|
||||||
$MD5_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.md5
|
$MD5_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.md5
|
||||||
@ -92,12 +80,10 @@ calculate_checksums () {
|
|||||||
$SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256
|
$SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256
|
||||||
$MD5_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.md5
|
$MD5_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.md5
|
||||||
$SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256
|
$SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256
|
||||||
$MD5_BIN target/$PLATFORM/release/whisper$S3WIN > whisper$S3WIN.md5
|
|
||||||
$SHA256_BIN target/$PLATFORM/release/whisper$S3WIN > whisper$S3WIN.sha256
|
|
||||||
}
|
}
|
||||||
make_deb () {
|
make_deb () {
|
||||||
rm -rf deb
|
rm -rf deb
|
||||||
echo "create DEBIAN files"
|
echo "__________Create DEBIAN files__________"
|
||||||
mkdir -p deb/usr/bin/
|
mkdir -p deb/usr/bin/
|
||||||
mkdir -p deb/DEBIAN
|
mkdir -p deb/DEBIAN
|
||||||
echo "create copyright, docs, compat"
|
echo "create copyright, docs, compat"
|
||||||
@ -122,24 +108,23 @@ make_deb () {
|
|||||||
echo "Description: Ethereum network client by Parity Technologies" >> $control
|
echo "Description: Ethereum network client by Parity Technologies" >> $control
|
||||||
size=`du deb/|awk 'END {print $1}'`
|
size=`du deb/|awk 'END {print $1}'`
|
||||||
echo "Installed-Size: $size" >> $control
|
echo "Installed-Size: $size" >> $control
|
||||||
echo "build .deb package"
|
echo "__________Build .deb package__________"
|
||||||
cp target/$PLATFORM/release/parity deb/usr/bin/parity
|
cp target/$PLATFORM/release/parity deb/usr/bin/parity
|
||||||
cp target/$PLATFORM/release/parity-evm deb/usr/bin/parity-evm
|
cp target/$PLATFORM/release/parity-evm deb/usr/bin/parity-evm
|
||||||
cp target/$PLATFORM/release/ethstore deb/usr/bin/ethstore
|
cp target/$PLATFORM/release/ethstore deb/usr/bin/ethstore
|
||||||
cp target/$PLATFORM/release/ethkey deb/usr/bin/ethkey
|
cp target/$PLATFORM/release/ethkey deb/usr/bin/ethkey
|
||||||
cp target/$PLATFORM/release/whisper deb/usr/bin/whisper
|
|
||||||
dpkg-deb -b deb "parity_"$VER"_"$IDENT"_"$ARC".deb"
|
dpkg-deb -b deb "parity_"$VER"_"$IDENT"_"$ARC".deb"
|
||||||
$MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.md5"
|
$MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.md5"
|
||||||
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.sha256"
|
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.sha256"
|
||||||
}
|
}
|
||||||
make_rpm () {
|
make_rpm () {
|
||||||
rm -rf /install
|
rm -rf /install
|
||||||
|
echo "__________Create RPM package__________"
|
||||||
mkdir -p /install/usr/bin
|
mkdir -p /install/usr/bin
|
||||||
cp target/$PLATFORM/release/parity /install/usr/bin
|
cp target/$PLATFORM/release/parity /install/usr/bin
|
||||||
cp target/$PLATFORM/release/parity-evm /install/usr/bin/parity-evm
|
cp target/$PLATFORM/release/parity-evm /install/usr/bin/parity-evm
|
||||||
cp target/$PLATFORM/release/ethstore /install/usr/bin/ethstore
|
cp target/$PLATFORM/release/ethstore /install/usr/bin/ethstore
|
||||||
cp target/$PLATFORM/release/ethkey /install/usr/bin/ethkey
|
cp target/$PLATFORM/release/ethkey /install/usr/bin/ethkey
|
||||||
cp target/$PLATFORM/release/whisper /install/usr/bin/whisper
|
|
||||||
|
|
||||||
rm -rf "parity-"$VER"-1."$ARC".rpm" || true
|
rm -rf "parity-"$VER"-1."$ARC".rpm" || true
|
||||||
fpm -s dir -t rpm -n parity -v $VER --epoch 1 --license GPLv3 -d openssl --provides parity --url https://parity.io --vendor "Parity Technologies" -a x86_64 -m "<devops@parity.io>" --description "Ethereum network client by Parity Technologies" -C /install/
|
fpm -s dir -t rpm -n parity -v $VER --epoch 1 --license GPLv3 -d openssl --provides parity --url https://parity.io --vendor "Parity Technologies" -a x86_64 -m "<devops@parity.io>" --description "Ethereum network client by Parity Technologies" -C /install/
|
||||||
@ -148,12 +133,11 @@ make_rpm () {
|
|||||||
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.sha256"
|
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.sha256"
|
||||||
}
|
}
|
||||||
make_pkg () {
|
make_pkg () {
|
||||||
echo "make PKG"
|
echo "__________Make OSX PKG__________"
|
||||||
cp target/$PLATFORM/release/parity target/release/parity
|
cp target/$PLATFORM/release/parity target/release/parity
|
||||||
cp target/$PLATFORM/release/parity-evm target/release/parity-evm
|
cp target/$PLATFORM/release/parity-evm target/release/parity-evm
|
||||||
cp target/$PLATFORM/release/ethstore target/release/ethstore
|
cp target/$PLATFORM/release/ethstore target/release/ethstore
|
||||||
cp target/$PLATFORM/release/ethkey target/release/ethkey
|
cp target/$PLATFORM/release/ethkey target/release/ethkey
|
||||||
cp target/$PLATFORM/release/whisper target/release/whisper
|
|
||||||
cd mac
|
cd mac
|
||||||
xcodebuild -configuration Release
|
xcodebuild -configuration Release
|
||||||
cd ..
|
cd ..
|
||||||
@ -164,11 +148,13 @@ make_pkg () {
|
|||||||
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT >> "parity_"$VER"_"$IDENT"_"$ARC".pkg.sha256"
|
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT >> "parity_"$VER"_"$IDENT"_"$ARC".pkg.sha256"
|
||||||
}
|
}
|
||||||
sign_exe () {
|
sign_exe () {
|
||||||
|
if [[ -z "$protect" ]]; then echo "__________Skipping sign binaries__________"&&return; fi
|
||||||
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe"
|
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe"
|
||||||
|
./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe
|
||||||
}
|
}
|
||||||
make_exe () {
|
make_exe () {
|
||||||
./msbuild.cmd
|
./msbuild.cmd
|
||||||
./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe
|
sign_exe
|
||||||
cd nsis
|
cd nsis
|
||||||
curl -sL --url "https://github.com/paritytech/win-build/raw/master/vc_redist.x64.exe" -o vc_redist.x64.exe
|
curl -sL --url "https://github.com/paritytech/win-build/raw/master/vc_redist.x64.exe" -o vc_redist.x64.exe
|
||||||
echo "makensis.exe installer.nsi" > nsis.cmd
|
echo "makensis.exe installer.nsi" > nsis.cmd
|
||||||
@ -179,8 +165,71 @@ make_exe () {
|
|||||||
$MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5"
|
$MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5"
|
||||||
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256"
|
$SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256"
|
||||||
}
|
}
|
||||||
|
push_snap () {
|
||||||
|
if [[ -z "$protect" ]]; then echo "__________Skipping push and release snap__________"&&return; fi
|
||||||
|
snapcraft_login=$(expect -c "
|
||||||
|
spawn snapcraft login
|
||||||
|
expect \"Email:\"
|
||||||
|
send \"$SNAP_EMAIL\n\"
|
||||||
|
expect \"Password:\"
|
||||||
|
send \"$SNAP_PASS\n\"
|
||||||
|
expect \"\$\"
|
||||||
|
")
|
||||||
|
echo "$snapcraft_login"
|
||||||
|
snapcraft push "parity_"$VER"_"$ARC".snap" >> push.log
|
||||||
|
cat push.log
|
||||||
|
REVISION="$(grep -m 1 "Revision " push.log | awk '{print $2}')"
|
||||||
|
echo "__________Revision__________"
|
||||||
|
echo $REVISION
|
||||||
|
sleep 120
|
||||||
|
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.9* ]];
|
||||||
|
then
|
||||||
|
snapcraft release parity_"$VER"_"$ARC".snap $REVISION beta
|
||||||
|
snapcraft release parity_"$VER"_"$ARC".snap $REVISION candidate;
|
||||||
|
fi
|
||||||
|
if [[ "$CI_BUILD_REF_NAME" = "nightly" ]];
|
||||||
|
then
|
||||||
|
snapcraft release parity_"$VER"_"$ARC".snap $REVISION edge;
|
||||||
|
fi
|
||||||
|
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.8* ]];
|
||||||
|
then
|
||||||
|
snapcraft release parity_"$VER"_"$ARC".snap $REVISION stable;
|
||||||
|
fi
|
||||||
|
snapcraft status parity
|
||||||
|
snapcraft logout
|
||||||
|
}
|
||||||
|
make_snap () {
|
||||||
|
export HOST_CC=gcc
|
||||||
|
export HOST_CXX=g++
|
||||||
|
apt install -y expect zip rhash
|
||||||
|
snapcraft clean
|
||||||
|
echo "__________ Prepare snapcraft.yaml for build on Gitlab CI in Docker image __________"
|
||||||
|
sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml
|
||||||
|
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.9* ]];
|
||||||
|
then
|
||||||
|
sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml;
|
||||||
|
fi
|
||||||
|
if [[ "$ARC" = "i386" ]];
|
||||||
|
then
|
||||||
|
export ARCH=i686&&ln -s /usr/bin/gcc /usr/bin/i386-linux-gnu-gcc;
|
||||||
|
fi
|
||||||
|
mv -f snap/snapcraft.yaml snapcraft.yaml
|
||||||
|
snapcraft --target-arch=$ARC -d
|
||||||
|
echo "__________Build comlete__________"
|
||||||
|
push_snap
|
||||||
|
echo "__________Checksum calculation__________"
|
||||||
|
$MD5_BIN "parity_"$VER"_"$ARC".snap" > "parity_"$VER"_"$ARC".snap.md5"
|
||||||
|
$SHA256_BIN "parity_"$VER"_"$ARC".snap" > "parity_"$VER"_"$ARC".snap.sha256"
|
||||||
|
echo "__________Copy all artifacts to one place__________"
|
||||||
|
rm -rf artifacts
|
||||||
|
mkdir -p artifacts
|
||||||
|
cp "parity_"$VER"_"$ARC".snap" artifacts
|
||||||
|
cp "parity_"$VER"_"$ARC".snap.md5" artifacts
|
||||||
|
cp "parity_"$VER"_"$ARC".snap.sha256" artifacts
|
||||||
|
}
|
||||||
push_binaries () {
|
push_binaries () {
|
||||||
echo "Push binaries to AWS S3"
|
if [[ -z "$protect" ]]; then echo "__________Skipping push to S3__________"&&return; fi
|
||||||
|
echo "__________Push binaries to AWS S3__________"
|
||||||
aws configure set aws_access_key_id $s3_key
|
aws configure set aws_access_key_id $s3_key
|
||||||
aws configure set aws_secret_access_key $s3_secret
|
aws configure set aws_secret_access_key $s3_secret
|
||||||
if [[ "$CI_BUILD_REF_NAME" = "master" || "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]];
|
if [[ "$CI_BUILD_REF_NAME" = "master" || "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]];
|
||||||
@ -202,54 +251,58 @@ push_binaries () {
|
|||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.md5 --body ethkey$S3WIN.md5
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.md5 --body ethkey$S3WIN.md5
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN --body target/$PLATFORM/release/whisper$S3WIN
|
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN.md5 --body whisper$S3WIN.md5
|
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN.sha256 --body whisper$S3WIN.sha256
|
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5"
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5"
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256"
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256"
|
||||||
}
|
}
|
||||||
make_archive () {
|
prepare_artifacts () {
|
||||||
echo "add artifacts to archive"
|
echo "__________Copy all artifacts to one place__________"
|
||||||
rm -rf parity.zip
|
rm -rf artifacts
|
||||||
zip -r parity.zip target/$PLATFORM/release/parity$S3WIN target/$PLATFORM/release/parity-evm$S3WIN target/$PLATFORM/release/ethstore$S3WIN target/$PLATFORM/release/ethkey$S3WIN target/$PLATFORM/release/whisper$S3WIN parity$S3WIN.md5 parity-evm$S3WIN.md5 ethstore$S3WIN.md5 ethkey$S3WIN.md5 whisper$S3WIN.md5 parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256 whisper$S3WIN.sha256
|
mkdir -p artifacts
|
||||||
|
cp target/$PLATFORM/release/parity$S3WIN artifacts
|
||||||
|
cp target/$PLATFORM/release/parity-evm$S3WIN artifacts
|
||||||
|
cp target/$PLATFORM/release/ethstore$S3WIN artifacts
|
||||||
|
cp target/$PLATFORM/release/ethkey$S3WIN parity$S3WIN.md5 artifacts
|
||||||
|
cp parity-evm$S3WIN.md5 ethstore$S3WIN.md5 artifacts
|
||||||
|
cp ethkey$S3WIN.md5 artifacts
|
||||||
|
cp parity$S3WIN.sha256 artifacts
|
||||||
|
cp parity-evm$S3WIN.sha256 artifacts
|
||||||
|
cp ethstore$S3WIN.sha256 artifacts
|
||||||
|
cp ethkey$S3WIN.sha256 artifacts
|
||||||
}
|
}
|
||||||
|
|
||||||
updater_push_release () {
|
updater_push_release () {
|
||||||
echo "push release"
|
echo "__________Build comlete__________"
|
||||||
|
if [[ -z "$protect" ]]; then echo "__________Skipping push release__________"&&return; fi
|
||||||
|
echo "__________Push release___________"
|
||||||
DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET"
|
DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET"
|
||||||
# Mainnet
|
# Mainnet
|
||||||
source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
|
source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
|
||||||
# Kovan
|
# Kovan
|
||||||
source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
|
source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
|
||||||
}
|
}
|
||||||
|
build_and_push () {
|
||||||
|
build
|
||||||
|
strip_binaries
|
||||||
|
calculate_checksums
|
||||||
|
make_deb
|
||||||
|
prepare_artifacts
|
||||||
|
push_binaries
|
||||||
|
updater_push_release
|
||||||
|
}
|
||||||
case $BUILD_PLATFORM in
|
case $BUILD_PLATFORM in
|
||||||
x86_64-unknown-linux-gnu)
|
x86_64-unknown-linux-gnu)
|
||||||
#set strip bin
|
#set strip bin
|
||||||
STRIP_BIN="strip"
|
STRIP_BIN="strip"
|
||||||
#package extention
|
#package extention
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
updater_push_release
|
|
||||||
;;
|
;;
|
||||||
x86_64-unknown-debian-gnu)
|
x86_64-unknown-debian-gnu)
|
||||||
STRIP_BIN="strip"
|
STRIP_BIN="strip"
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
LIBSSL="libssl1.1 (>=1.1.0)"
|
LIBSSL="libssl1.1 (>=1.1.0)"
|
||||||
echo "Use libssl1.1 (>=1.1.0) for Debian builds"
|
echo "__________Use libssl1.1 (>=1.1.0) for Debian builds__________"
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
;;
|
;;
|
||||||
x86_64-unknown-centos-gnu)
|
x86_64-unknown-centos-gnu)
|
||||||
STRIP_BIN="strip"
|
STRIP_BIN="strip"
|
||||||
@ -258,52 +311,33 @@ case $BUILD_PLATFORM in
|
|||||||
strip_binaries
|
strip_binaries
|
||||||
calculate_checksums
|
calculate_checksums
|
||||||
make_rpm
|
make_rpm
|
||||||
make_archive
|
prepare_artifacts
|
||||||
push_binaries
|
push_binaries
|
||||||
|
updater_push_release
|
||||||
;;
|
;;
|
||||||
i686-unknown-linux-gnu)
|
i686-unknown-linux-gnu)
|
||||||
STRIP_BIN="strip"
|
STRIP_BIN="strip"
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
set_env
|
set_env
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
;;
|
;;
|
||||||
armv7-unknown-linux-gnueabihf)
|
armv7-unknown-linux-gnueabihf)
|
||||||
STRIP_BIN="arm-linux-gnueabihf-strip"
|
STRIP_BIN="arm-linux-gnueabihf-strip"
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
set_env
|
set_env
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
;;
|
;;
|
||||||
arm-unknown-linux-gnueabihf)
|
arm-unknown-linux-gnueabihf)
|
||||||
STRIP_BIN="arm-linux-gnueabihf-strip"
|
STRIP_BIN="arm-linux-gnueabihf-strip"
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
set_env
|
set_env
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
;;
|
;;
|
||||||
aarch64-unknown-linux-gnu)
|
aarch64-unknown-linux-gnu)
|
||||||
STRIP_BIN="aarch64-linux-gnu-strip"
|
STRIP_BIN="aarch64-linux-gnu-strip"
|
||||||
EXT="deb"
|
EXT="deb"
|
||||||
set_env
|
set_env
|
||||||
build
|
build_and_push
|
||||||
strip_binaries
|
|
||||||
calculate_checksums
|
|
||||||
make_deb
|
|
||||||
make_archive
|
|
||||||
push_binaries
|
|
||||||
;;
|
;;
|
||||||
x86_64-apple-darwin)
|
x86_64-apple-darwin)
|
||||||
STRIP_BIN="strip"
|
STRIP_BIN="strip"
|
||||||
@ -313,41 +347,22 @@ case $BUILD_PLATFORM in
|
|||||||
strip_binaries
|
strip_binaries
|
||||||
calculate_checksums
|
calculate_checksums
|
||||||
make_pkg
|
make_pkg
|
||||||
make_archive
|
prepare_artifacts
|
||||||
push_binaries
|
push_binaries
|
||||||
updater_push_release
|
updater_push_release
|
||||||
;;
|
;;
|
||||||
x86_64-unknown-snap-gnu)
|
x86_64-unknown-snap-gnu)
|
||||||
ARC="amd64"
|
make_snap
|
||||||
EXT="snap"
|
;;
|
||||||
apt update
|
i686-unknown-snap-gnu)
|
||||||
apt install -y expect zip rhash
|
set_env
|
||||||
snapcraft clean
|
make_snap
|
||||||
echo "Prepare snapcraft.yaml for build on Gitlab CI in Docker image"
|
;;
|
||||||
sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml
|
arm64-unknown-snap-gnu)
|
||||||
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.11* ]];
|
make_snap
|
||||||
then
|
;;
|
||||||
sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml;
|
armhf-unknown-snap-gnu)
|
||||||
fi
|
make_snap
|
||||||
mv -f snap/snapcraft.yaml snapcraft.yaml
|
|
||||||
snapcraft -d
|
|
||||||
snapcraft_login=$(expect -c "
|
|
||||||
spawn snapcraft login
|
|
||||||
expect \"Email:\"
|
|
||||||
send \"$SNAP_EMAIL\n\"
|
|
||||||
expect \"Password:\"
|
|
||||||
send \"$SNAP_PASS\n\"
|
|
||||||
expect \"\$\"
|
|
||||||
")
|
|
||||||
echo "$snapcraft_login"
|
|
||||||
snapcraft push "parity_"$VER"_amd64.snap"
|
|
||||||
snapcraft status parity
|
|
||||||
snapcraft logout
|
|
||||||
$MD5_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.md5"
|
|
||||||
$SHA256_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256"
|
|
||||||
echo "add artifacts to archive"
|
|
||||||
rm -rf parity.zip
|
|
||||||
zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.md5" "parity_"$VER"_amd64.snap.sha256"
|
|
||||||
;;
|
;;
|
||||||
x86_64-pc-windows-msvc)
|
x86_64-pc-windows-msvc)
|
||||||
set_env_win
|
set_env_win
|
||||||
@ -357,7 +372,7 @@ case $BUILD_PLATFORM in
|
|||||||
sign_exe
|
sign_exe
|
||||||
calculate_checksums
|
calculate_checksums
|
||||||
make_exe
|
make_exe
|
||||||
make_archive
|
prepare_artifacts
|
||||||
push_binaries
|
push_binaries
|
||||||
updater_push_release
|
updater_push_release
|
||||||
esac
|
esac
|
7
scripts/gitlab/clippy.sh
Normal file
7
scripts/gitlab/clippy.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
cargo install clippy
|
||||||
|
cargo clippy -- -D warnings
|
23
scripts/gitlab/coverage.sh
Normal file
23
scripts/gitlab/coverage.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
git submodule update --init --recursive
|
||||||
|
rm -rf target/*
|
||||||
|
cargo test --all --exclude evmjit --no-run || exit $?
|
||||||
|
KCOV_TARGET="target/cov"
|
||||||
|
KCOV_FLAGS="--verify"
|
||||||
|
EXCLUDE="/usr/lib,/usr/include,$HOME/.cargo,$HOME/.multirust,rocksdb,secp256k1"
|
||||||
|
mkdir -p $KCOV_TARGET
|
||||||
|
echo "__________Cover RUST___________"
|
||||||
|
for FILE in `find target/debug/deps ! -name "*.*"`
|
||||||
|
do
|
||||||
|
timeout --signal=SIGKILL 5m kcov --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE
|
||||||
|
done
|
||||||
|
timeout --signal=SIGKILL 5m kcov --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-*
|
||||||
|
echo "Cover JS"
|
||||||
|
cd ../../js
|
||||||
|
npm install&&npm run test:coverage
|
||||||
|
cd ..
|
||||||
|
bash <(curl -s https://codecov.io/bash)&&
|
||||||
|
echo "Uploaded code coverage"
|
||||||
|
exit 0
|
8
scripts/gitlab/install-readme.sh
Normal file
8
scripts/gitlab/install-readme.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
echo "Parity Wallet
|
||||||
|
=============
|
||||||
|
|
||||||
|
Welcome to Parity Wallet, your all-in-one Ethereum node and wallet.
|
||||||
|
|
||||||
|
If you continue, Parity will be installed as a user service. You will be able to use the Parity Wallet through your browser by using the menu bar icon, following the shortcut in the Launchpad or navigating to http://localhost:8180/ in your browser.
|
||||||
|
|
||||||
|
Parity is distributed under the terms of the GPL."
|
1
scripts/gitlab/msbuild.cmd
Normal file
1
scripts/gitlab/msbuild.cmd
Normal file
@ -0,0 +1 @@
|
|||||||
|
MsBuild.exe windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release
|
19
scripts/gitlab/package-macos.sh
Normal file
19
scripts/gitlab/package-macos.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
OSX_PACKAGE="parity_"$VERSION"_macos_x86_64.pkg"
|
||||||
|
echo "__________Create MacOS package__________"
|
||||||
|
cd mac
|
||||||
|
xcodebuild -configuration Release
|
||||||
|
cd ..
|
||||||
|
packagesbuild -v mac/Parity.pkgproj
|
||||||
|
echo "__________Sign Package__________"
|
||||||
|
find . -name \*.pkg
|
||||||
|
productsign --sign 'Developer ID Installer: PARITY TECHNOLOGIES LIMITED (P2PX3JU8FT)' Parity\ Ethereum.pkg $OSX_PACKAGE
|
||||||
|
echo "__________Move package to artifacts__________"
|
||||||
|
mkdir -p packages
|
||||||
|
mv -v $OSX_PACKAGE packages/$OSX_PACKAGE
|
||||||
|
cd packages
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
rhash --sha256 "parity_"$VERSION"_macos_x86_64.pkg" >> "parity_"$VERSION"_macos_x86_64.pkg.sha256"
|
25
scripts/gitlab/package-snap.sh
Normal file
25
scripts/gitlab/package-snap.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
case ${CI_COMMIT_REF_NAME} in
|
||||||
|
master|*v1.12*|gitlab-next) export GRADE="devel";;
|
||||||
|
beta|*v1.11*) export GRADE="stable";;
|
||||||
|
stable|*v1.10*) export GRADE="stable";;
|
||||||
|
*) echo "No release" exit 0;;
|
||||||
|
esac
|
||||||
|
SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap"
|
||||||
|
echo "__________Create snap package__________"
|
||||||
|
echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME
|
||||||
|
snapcraft clean
|
||||||
|
echo $VERSION:$GRADE:$BUILD_ARCH
|
||||||
|
cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH' > snapcraft.yaml
|
||||||
|
cat snapcraft.yaml
|
||||||
|
snapcraft --target-arch=$BUILD_ARCH
|
||||||
|
ls *.snap
|
||||||
|
echo "__________Post-processing snap package__________"
|
||||||
|
mkdir -p packages
|
||||||
|
mv -v $SNAP_PACKAGE "packages/"$SNAP_PACKAGE
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
cd packages
|
||||||
|
rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256"
|
35
scripts/gitlab/package-unix.sh
Normal file
35
scripts/gitlab/package-unix.sh
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
rm -rf /install
|
||||||
|
mkdir -p packages
|
||||||
|
echo "__________Create "$PKG" package__________"
|
||||||
|
PACKAGE="parity_"$VERSION"_"$IDENT"_"$BUILD_ARCH"."$PKG
|
||||||
|
mkdir -p /install/usr/bin
|
||||||
|
cp artifacts/parity /install/usr/bin
|
||||||
|
cp artifacts/parity-evm /install/usr/bin/parity-evm
|
||||||
|
cp artifacts/ethstore /install/usr/bin/ethstore
|
||||||
|
cp artifacts/ethkey /install/usr/bin/ethkey
|
||||||
|
cp scripts/gitlab/uninstall-parity.sh /install/usr/bin/uninstall-parity.sh
|
||||||
|
fpm --input-type dir \
|
||||||
|
--output-type $PKG \
|
||||||
|
--name parity \
|
||||||
|
--version $VERSION \
|
||||||
|
--license GPLv3 \
|
||||||
|
--depends "$LIBSSL" \
|
||||||
|
--provides parity \
|
||||||
|
--url https://parity.io \
|
||||||
|
--vendor "Parity Technologies" \
|
||||||
|
--architecture $BUILD_ARCH \
|
||||||
|
--maintainer "<devops@parity.io>" \
|
||||||
|
--description "Ethereum network client by Parity Technologies" \
|
||||||
|
--before-install scripts/gitlab/install-readme.sh \
|
||||||
|
--before-upgrade scripts/gitlab/uninstall-parity.sh \
|
||||||
|
--after-remove scripts/gitlab/uninstall-parity.sh \
|
||||||
|
-C /install \
|
||||||
|
-p packages/$PACKAGE
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
cd packages
|
||||||
|
rhash --sha256 $PACKAGE > $PACKAGE".sha256"
|
27
scripts/gitlab/package-windows.sh
Normal file
27
scripts/gitlab/package-windows.sh
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
|
||||||
|
echo "__________Create Windows package__________"
|
||||||
|
scripts/gitlab/msbuild.cmd
|
||||||
|
echo "__________Sign binaries__________"
|
||||||
|
scripts/gitlab/sign.cmd $keyfile $certpass artifacts/parity.exe
|
||||||
|
scripts/gitlab/sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe
|
||||||
|
echo "__________Create Windows installer__________"
|
||||||
|
cd nsis
|
||||||
|
curl -sL --url "https://github.com/paritytech/win-build/raw/master/vc_redist.x64.exe" -o vc_redist.x64.exe
|
||||||
|
echo "makensis.exe installer.nsi" > nsis.cmd
|
||||||
|
./nsis.cmd
|
||||||
|
cd ..
|
||||||
|
echo "__________Move package to artifacts__________"
|
||||||
|
mkdir -p packages
|
||||||
|
cp nsis/installer.exe packages/"parity_"$VERSION"_windows_x86_64.exe"
|
||||||
|
echo "__________Sign installer__________"
|
||||||
|
scripts/gitlab/sign.cmd $keyfile $certpass packages/"parity_"$VERSION"_windows_x86_64.exe"
|
||||||
|
echo "_____ Calculating checksums _____"
|
||||||
|
cd packages
|
||||||
|
for binary in $(ls)
|
||||||
|
do
|
||||||
|
rhash --sha256 $binary -o $binary.sha256
|
||||||
|
done
|
22
scripts/gitlab/publish-docker.sh
Normal file
22
scripts/gitlab/publish-docker.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
##ARGUMENTS: 1. Docker target
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
if [ "$CI_COMMIT_REF_NAME" == "beta" ];
|
||||||
|
then export DOCKER_BUILD_TAG="latest";
|
||||||
|
else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME;
|
||||||
|
fi
|
||||||
|
docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
|
||||||
|
|
||||||
|
echo "__________Docker TAG__________"
|
||||||
|
echo $DOCKER_BUILD_TAG
|
||||||
|
|
||||||
|
echo "__________Docker target__________"
|
||||||
|
export DOCKER_TARGET=$1
|
||||||
|
echo $DOCKER_TARGET
|
||||||
|
|
||||||
|
echo "__________Docker build and push__________"
|
||||||
|
docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f docker/hub/Dockerfile .
|
||||||
|
docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG
|
||||||
|
docker logout
|
18
scripts/gitlab/publish-snap.sh
Normal file
18
scripts/gitlab/publish-snap.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
case ${CI_COMMIT_REF_NAME} in
|
||||||
|
master|*v1.12*|gitlab-next) export CHANNEL="edge";;
|
||||||
|
beta|*v1.11*) export CHANNEL="beta";;
|
||||||
|
stable|*v1.10*) export CHANNEL="stable";;
|
||||||
|
*) echo "No release" exit 0;;
|
||||||
|
esac
|
||||||
|
echo "Release channel :" $CHANNEL " Branch/tag: " $CI_COMMIT_REF_NAME
|
||||||
|
|
||||||
|
echo $SNAPCRAFT_LOGIN_PARITY_BASE64 | base64 --decode > snapcraft.login
|
||||||
|
snapcraft login --with snapcraft.login
|
||||||
|
snapcraft push --release $CHANNEL "packages/parity_"$VERSION"_"$BUILD_ARCH".snap"
|
||||||
|
snapcraft status parity
|
||||||
|
snapcraft logout
|
25
scripts/gitlab/push-binaries.sh
Normal file
25
scripts/gitlab/push-binaries.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
echo "__________Push binaries to AWS S3__________"
|
||||||
|
aws configure set aws_access_key_id $s3_key
|
||||||
|
aws configure set aws_secret_access_key $s3_secret
|
||||||
|
if [[ "$CI_BUILD_REF_NAME" = "master" || "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]];
|
||||||
|
then
|
||||||
|
export S3_BUCKET=builds-parity-published;
|
||||||
|
else
|
||||||
|
export S3_BUCKET=builds-parity;
|
||||||
|
fi
|
||||||
|
aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$BUILD_PLATFORM
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN --body target/$PLATFORM/release/parity$S3WIN
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.md5 --body parity$S3WIN.md5
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.sha256 --body parity$S3WIN.sha256
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN --body target/$PLATFORM/release/parity-evm$S3WIN
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.md5 --body parity-evm$S3WIN.md5
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.sha256 --body parity-evm$S3WIN.sha256
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN --body target/$PLATFORM/release/ethstore$S3WIN
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.md5 --body ethstore$S3WIN.md5
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.sha256 --body ethstore$S3WIN.sha256
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.md5 --body ethkey$S3WIN.md5
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5"
|
||||||
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256"
|
38
scripts/gitlab/push-github.sh
Normal file
38
scripts/gitlab/push-github.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
echo "__________Set ENVIROMENT__________"
|
||||||
|
DOWNLOAD_PREFIX="https://github.com/General-Beck/parity/releases/download/"$CI_COMMIT_REF_NAME"/"
|
||||||
|
DESCRIPTION="$(cat CHANGELOG.md)"
|
||||||
|
RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)"
|
||||||
|
RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$VERSION/${VERSION}}")"
|
||||||
|
RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$DOWNLOAD_PREFIX/${DOWNLOAD_PREFIX}}")"
|
||||||
|
#The text in the file CANGELOG.md before which the table with links is inserted. Must be present in this file necessarily
|
||||||
|
REPLACE_TEXT="The full list of included changes:"
|
||||||
|
case ${CI_COMMIT_REF_NAME} in
|
||||||
|
master|*v1.12*|nightly) NAME="Parity "$VERSION" nightly";;
|
||||||
|
beta|*v1.11*) NAME="Parity "$VERSION" beta";;
|
||||||
|
stable|*v1.10*) NAME="Parity "$VERSION" stable";;
|
||||||
|
*) echo "No release" exit 0;;
|
||||||
|
esac
|
||||||
|
cd packages
|
||||||
|
i=1
|
||||||
|
for binary in $(ls *.sha256)
|
||||||
|
do
|
||||||
|
sha256=$(cat $binary | awk '{ print $1}' )
|
||||||
|
RELEASE_TABLE="$(echo "${RELEASE_TABLE/sha${i}/${sha256}}")"
|
||||||
|
let ++i
|
||||||
|
done
|
||||||
|
#do not touch the following 3 lines. Features of output in Markdown
|
||||||
|
DESCRIPTION="$(echo "${DESCRIPTION/${REPLACE_TEXT}/${RELEASE_TABLE}
|
||||||
|
|
||||||
|
${REPLACE_TEXT}}")"
|
||||||
|
echo "__________Create release to Github____________"
|
||||||
|
github-release release --user "$GITHUB_USER" --repo parity --tag "$CI_COMMIT_REF_NAME" --draft --name "$NAME" --description "$DESCRIPTION"
|
||||||
|
echo "__________Upload files to Github____________"
|
||||||
|
|
||||||
|
for binary in $(ls -I "*.sha256")
|
||||||
|
do
|
||||||
|
github-release upload --user "$GITHUB_USER" --repo parity --tag "$CI_COMMIT_REF_NAME" --replace --name "$binary" --file $binary
|
||||||
|
done
|
0
scripts/gitlab-push-release.sh → scripts/gitlab/push-release.sh
Executable file → Normal file
0
scripts/gitlab-push-release.sh → scripts/gitlab/push-release.sh
Executable file → Normal file
7
scripts/gitlab/rustfmt.sh
Normal file
7
scripts/gitlab/rustfmt.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
cargo install rustfmt-nightly
|
||||||
|
cargo fmt -- --write-mode=diff
|
1
scripts/gitlab/sign.cmd
Normal file
1
scripts/gitlab/sign.cmd
Normal file
@ -0,0 +1 @@
|
|||||||
|
@signtool sign /f %1 /p %2 /tr http://timestamp.comodoca.com /du https://parity.io %3
|
16
scripts/gitlab/templates/release-table.md
Normal file
16
scripts/gitlab/templates/release-table.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
| OS | Arch | Download | SHA256 Checksum |
|
||||||
|
|:---:|:---:|:---|:---|
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [parity_$VERSION_centos_x86_64.rpm]($DOWNLOAD_PREFIXparity_$VERSION_centos_x86_64.rpm) | <sup>`sha1`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [parity_$VERSION_debian_amd64.deb]($DOWNLOAD_PREFIXx86_64-unknown-debian-gnu/parity_$VERSION_debian_amd64.deb) | <sup>`sha2`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/apple.png" alt="Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [parity_$VERSION_macos_macos.pkg]($DOWNLOAD_PREFIXx86_64-apple-darwin/parity_$VERSION_macos_macos.pkg) | <sup>`sha3`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [parity_$VERSION_ubuntu_amd64.deb]($DOWNLOAD_PREFIXx86_64-unknown-linux-gnu/parity_$VERSION_ubuntu_amd64.deb) | <sup>`sha4`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | arm64 | [parity_$VERSION_ubuntu_arm64.deb]($DOWNLOAD_PREFIXaarch64-unknown-linux-gnu/parity_$VERSION_ubuntu_arm64.deb) | <sup>`sha5`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | armv7 | [parity_$VERSION_ubuntu_armhf.deb]($DOWNLOAD_PREFIXarmv7-unknown-linux-gnueabihf/parity_$VERSION_ubuntu_armhf.deb) | <sup>`sha6`</sup> |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/windows.png" alt="Windows Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [parity_$VERSION_windows_x86_64.exe]($DOWNLOAD_PREFIXx86_64-pc-windows-msvc/parity_$VERSION_windows_x86_64.exe) | <sup>`sha7`</sup> |
|
||||||
|
|
||||||
|
| OS | Alternative | Link |
|
||||||
|
|:---:|:---:|:---|
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/apple.png" alt="Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Homebrew |[github.com/paritytech/homebrew-paritytech/blob/master/README.md](https://github.com/paritytech/homebrew-paritytech/blob/master/README.md) |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Snapcraft | [snapcraft.io/parity](https://snapcraft.io/parity/) |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Docker | [hub.docker.com/r/parity/parity](https://hub.docker.com/r/parity/parity) |
|
||||||
|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Other binaries | [vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION](https://vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION) |
|
54
scripts/gitlab/templates/snapcraft.template.yaml
Normal file
54
scripts/gitlab/templates/snapcraft.template.yaml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: parity
|
||||||
|
version: $VERSION
|
||||||
|
architectures: [$BUILD_ARCH]
|
||||||
|
grade: $GRADE
|
||||||
|
confinement: strict
|
||||||
|
|
||||||
|
summary: Fast, light, robust Ethereum implementation
|
||||||
|
description: |
|
||||||
|
Parity's goal is to be the fastest, lightest, and most secure Ethereum
|
||||||
|
client. We are developing Parity using the sophisticated and cutting-edge
|
||||||
|
Rust programming language. Parity is licensed under the GPLv3, and can be
|
||||||
|
used for all your Ethereum needs.
|
||||||
|
|
||||||
|
|
||||||
|
apps:
|
||||||
|
parity:
|
||||||
|
command: parity
|
||||||
|
plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland]
|
||||||
|
desktop: usr/share/applications/parity.desktop
|
||||||
|
parity-evm:
|
||||||
|
command: parity-evm
|
||||||
|
plugs: [home, network, network-bind]
|
||||||
|
ethkey:
|
||||||
|
command: ethkey
|
||||||
|
plugs: [home]
|
||||||
|
ethstore:
|
||||||
|
command: ethstore
|
||||||
|
plugs: [home]
|
||||||
|
|
||||||
|
icon: snap/gui/icon.png
|
||||||
|
|
||||||
|
parts:
|
||||||
|
desktop-icon:
|
||||||
|
source: ./snap
|
||||||
|
plugin: nil
|
||||||
|
override-build: |
|
||||||
|
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications
|
||||||
|
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
|
||||||
|
cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
|
||||||
|
cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/
|
||||||
|
parity:
|
||||||
|
source: ./artifacts
|
||||||
|
plugin: nil
|
||||||
|
override-build: |
|
||||||
|
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin
|
||||||
|
cp -v parity $SNAPCRAFT_PART_INSTALL/usr/bin/parity
|
||||||
|
cp -v parity-evm $SNAPCRAFT_PART_INSTALL/usr/bin/parity-evm
|
||||||
|
cp -v ethkey $SNAPCRAFT_PART_INSTALL/usr/bin/ethkey
|
||||||
|
cp -v ethstore $SNAPCRAFT_PART_INSTALL/usr/bin/ethstore
|
||||||
|
stage-packages: [libc6, libssl1.0.0, libudev1, libstdc++6]
|
||||||
|
df:
|
||||||
|
plugin: nil
|
||||||
|
stage-packages: [coreutils]
|
||||||
|
stage: [bin/df]
|
10
scripts/gitlab/test-qemu.sh
Normal file
10
scripts/gitlab/test-qemu.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
##ARGUMENTS: 1. Docker target
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
docker pull parity/rust-qemu:armhf
|
||||||
|
echo "Test wasmi on armhf"
|
||||||
|
docker run -it --rm -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static parity/rust-qemu:armhf \
|
||||||
|
bash `git clone https://github.com/paritytech/parity.git&&\
|
||||||
|
cd parity&&./test.sh&&cd ..&&rm -rf parity/`
|
28
scripts/gitlab/test.sh
Normal file
28
scripts/gitlab/test.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ARGUMENT $1 Rust flavor to test with (stable/beta/nightly)
|
||||||
|
|
||||||
|
set -e # fail on any error
|
||||||
|
set -u # treat unset variables as error
|
||||||
|
|
||||||
|
rustup default $1
|
||||||
|
|
||||||
|
if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then
|
||||||
|
export GIT_COMPARE=$CI_COMMIT_REF_NAME~;
|
||||||
|
else
|
||||||
|
export GIT_COMPARE=master;
|
||||||
|
fi
|
||||||
|
|
||||||
|
export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e ^mac/ -e ^nsis/ | wc -l)"
|
||||||
|
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"
|
||||||
|
|
||||||
|
git submodule update --init --recursive
|
||||||
|
rustup show
|
||||||
|
if [[ "${RUST_FILES_MODIFIED}" == "0" ]];
|
||||||
|
then echo "__________Skipping Rust tests since no Rust files modified__________";
|
||||||
|
else ./test.sh || exit $?;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]];
|
||||||
|
# ### @TODO re-enable fail after https://github.com/paritytech/parity-import-tests/issues/3
|
||||||
|
# then sh scripts/aura-test.sh; # || exit $?;
|
||||||
|
# fi
|
4
scripts/gitlab/uninstall-parity.sh
Normal file
4
scripts/gitlab/uninstall-parity.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo killall -9 parity && sleep 5
|
||||||
|
sudo rm -f /usr/bin/parity /usr/bin/uninstall-parity.sh /usr/bin/ethstore /usr/bin/ethkey /usr/bin/parity-evm
|
Loading…
Reference in New Issue
Block a user