Resolve conflicts

This commit is contained in:
Tomasz Drwięga 2018-02-13 19:31:06 +01:00 committed by 5chdn
parent 71bf7f5ed5
commit 7fb752e6a7
No known key found for this signature in database
GPG Key ID: 1A40871B597F5F80
6 changed files with 143 additions and 61 deletions

View File

@ -9,7 +9,7 @@ trim_trailing_whitespace=true
max_line_length=120 max_line_length=120
insert_final_newline=true insert_final_newline=true
[.travis.yml] [*.{yml,sh}]
indent_style=space indent_style=space
indent_size=2 indent_size=2
tab_width=8 tab_width=8

View File

@ -262,8 +262,6 @@ push-release:
- triggers - triggers
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- rustup default stable - scripts/gitlab-push-release.sh
- curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
- curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
tags: tags:
- curl - curl

View File

@ -9,7 +9,7 @@ ARC=$3
CC=$4 CC=$4
CXX=$5 CXX=$5
IDENT=$6 IDENT=$6
VER="$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")" VER="$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")"
S3WIN="" S3WIN=""
echo "--------------------" echo "--------------------"
echo "Build for platform: " $BUILD_PLATFORM echo "Build for platform: " $BUILD_PLATFORM
@ -22,6 +22,14 @@ echo "Parity version: " $VER
echo "Branch: " $CI_BUILD_REF_NAME echo "Branch: " $CI_BUILD_REF_NAME
echo "--------------------" echo "--------------------"
echo "Rhash version:"
# NOTE for md5 and sha256 we want to display filename as well
# hence we use --* instead of -p *
MD5_BIN="rhash --md5"
SHA256_BIN="rhash --sha256"
# NOTE For SHA3 we need only hash (hence -p)
SHA3_BIN="rhash -p %{sha3-256}"
set_env () { set_env () {
echo "Set ENVIROMENT" echo "Set ENVIROMENT"
export HOST_CC=gcc export HOST_CC=gcc
@ -52,26 +60,34 @@ build () {
echo "Build ethkey-cli:" echo "Build ethkey-cli:"
cargo build --target $PLATFORM --release -p ethkey-cli cargo build --target $PLATFORM --release -p ethkey-cli
} }
strip_md5 () { 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;
export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h) }
calculate_checksums () {
echo "Checksum calculation:" echo "Checksum calculation:"
rhash --version
rm -rf *.md5 rm -rf *.md5
rm -rf *.sha256 rm -rf *.sha256
export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h)
echo "Parity file SHA3:" $SHA3 export SHA3="$($SHA3_BIN target/$PLATFORM/release/parity$S3WIN)"
md5sum target/$PLATFORM/release/parity > parity.md5 # NOTE rhash 1.3.1 doesnt support keccak, workaround
sha256sum target/$PLATFORM/release/parity > parity.sha256 if [ "$SHA3" == "%{sha3-256}" ]; then
md5sum target/$PLATFORM/release/parity-evm > parity-evm.md5 export SHA3="$(target/$PLATFORM/release/parity$S3WIN tools hash target/$PLATFORM/release/parity$S3WIN)"
sha256sum target/$PLATFORM/release/parity-evm > parity-evm.sha256 fi
md5sum target/$PLATFORM/release/ethstore > ethstore.md5
sha256sum target/$PLATFORM/release/ethstore > ethstore.sha256 echo "Parity file SHA3: $SHA3"
md5sum target/$PLATFORM/release/ethkey > ethkey.md5 $MD5_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.md5
sha256sum target/$PLATFORM/release/ethkey > ethkey.sha256 $SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256
$MD5_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.md5
$SHA256_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.sha256
$MD5_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.md5
$SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256
$MD5_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.md5
$SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256
} }
make_deb () { make_deb () {
rm -rf deb rm -rf deb
@ -106,8 +122,8 @@ make_deb () {
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
dpkg-deb -b deb "parity_"$VER"_"$IDENT"_"$ARC".deb" dpkg-deb -b deb "parity_"$VER"_"$IDENT"_"$ARC".deb"
md5sum "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.md5" $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC".deb" > "parity_"$VER"_"$IDENT"_"$ARC".deb.md5"
sha256sum "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
@ -116,10 +132,12 @@ make_rpm () {
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
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/
cp "parity-"$VER"-1."$ARC".rpm" "parity_"$VER"_"$IDENT"_"$ARC".rpm" cp "parity-"$VER"-1."$ARC".rpm" "parity_"$VER"_"$IDENT"_"$ARC".rpm"
md5sum "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.md5" $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.md5"
sha256sum "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 PKG"
@ -133,24 +151,13 @@ make_pkg () {
packagesbuild -v mac/Parity.pkgproj packagesbuild -v mac/Parity.pkgproj
productsign --sign 'Developer ID Installer: PARITY TECHNOLOGIES LIMITED (P2PX3JU8FT)' target/release/Parity\ Ethereum.pkg target/release/Parity\ Ethereum-signed.pkg productsign --sign 'Developer ID Installer: PARITY TECHNOLOGIES LIMITED (P2PX3JU8FT)' target/release/Parity\ Ethereum.pkg target/release/Parity\ Ethereum-signed.pkg
mv target/release/Parity\ Ethereum-signed.pkg "parity_"$VER"_"$IDENT"_"$ARC".pkg" mv target/release/Parity\ Ethereum-signed.pkg "parity_"$VER"_"$IDENT"_"$ARC".pkg"
md5sum "parity_"$VER"_"$IDENT"_"$ARC"."$EXT >> "parity_"$VER"_"$IDENT"_"$ARC".pkg.md5" $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT >> "parity_"$VER"_"$IDENT"_"$ARC".pkg.md5"
sha256sum "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.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe"
} }
make_exe () { make_exe () {
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe"
SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity.exe -p %h)
echo "Checksum calculation:"
rm -rf *.md5
rm -rf *.sha256
echo "Parity file SHA3:" $SHA3
rhash --md5 target/$PLATFORM/release/parity.exe -p %h > parity.exe.md5
rhash --sha256 target/$PLATFORM/release/parity.exe -p %h > parity.exe.sha256
rhash --md5 target/$PLATFORM/release/parity-evm.exe -p %h > parity-evm.exe.md5
rhash --sha256 target/$PLATFORM/release/parity-evm.exe -p %h > parity-evm.exe.sha256
rhash --md5 target/$PLATFORM/release/ethstore.exe -p %h > ethstore.exe.md5
rhash --sha256 target/$PLATFORM/release/ethstore.exe -p %h > ethstore.exe.sha256
rhash --md5 target/$PLATFORM/release/ethkey.exe -p %h > ethkey.exe.md5
rhash --sha256 target/$PLATFORM/release/ethkey.exe -p %h > ethkey.exe.sha256
./msbuild.cmd ./msbuild.cmd
./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe ./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe
cd nsis cd nsis
@ -160,8 +167,8 @@ make_exe () {
cd .. cd ..
cp nsis/installer.exe "parity_"$VER"_"$IDENT"_"$ARC"."$EXT cp nsis/installer.exe "parity_"$VER"_"$IDENT"_"$ARC"."$EXT
./sign.cmd $keyfile $certpass "parity_"$VER"_"$IDENT"_"$ARC"."$EXT ./sign.cmd $keyfile $certpass "parity_"$VER"_"$IDENT"_"$ARC"."$EXT
rhash --md5 "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"
rhash --sha256 "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_binaries () { push_binaries () {
echo "Push binaries to AWS S3" echo "Push binaries to AWS S3"
@ -195,11 +202,17 @@ make_archive () {
rm -rf parity.zip rm -rf parity.zip
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 parity$S3WIN.md5 parity-evm$S3WIN.md5 ethstore$S3WIN.md5 ethkey$S3WIN.md5 parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256 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 parity$S3WIN.md5 parity-evm$S3WIN.md5 ethstore$S3WIN.md5 ethkey$S3WIN.md5 parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256
} }
push_release () {
updater_push_release () {
echo "push release" echo "push release"
curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET"
# Mainnet
source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
# Kovan
source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
} }
case $BUILD_PLATFORM in case $BUILD_PLATFORM in
x86_64-unknown-linux-gnu) x86_64-unknown-linux-gnu)
#set strip bin #set strip bin
@ -207,11 +220,12 @@ case $BUILD_PLATFORM in
#package extention #package extention
EXT="deb" EXT="deb"
build build
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release updater_push_release
;; ;;
x86_64-unknown-debian-gnu) x86_64-unknown-debian-gnu)
STRIP_BIN="strip" STRIP_BIN="strip"
@ -219,76 +233,77 @@ case $BUILD_PLATFORM in
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
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release
;; ;;
x86_64-unknown-centos-gnu) x86_64-unknown-centos-gnu)
STRIP_BIN="strip" STRIP_BIN="strip"
EXT="rpm" EXT="rpm"
build build
strip_md5 strip_binaries
calculate_checksums
make_rpm make_rpm
make_archive make_archive
push_binaries push_binaries
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
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release
;; ;;
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
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release
;; ;;
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
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release
;; ;;
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
strip_md5 strip_binaries
calculate_checksums
make_deb make_deb
make_archive make_archive
push_binaries push_binaries
push_release
;; ;;
x86_64-apple-darwin) x86_64-apple-darwin)
STRIP_BIN="strip" STRIP_BIN="strip"
PLATFORM="x86_64-apple-darwin" PLATFORM="x86_64-apple-darwin"
EXT="pkg" EXT="pkg"
build build
strip_md5 strip_binaries
calculate_checksums
make_pkg make_pkg
make_archive make_archive
push_binaries push_binaries
push_release updater_push_release
;; ;;
x86_64-unknown-snap-gnu) x86_64-unknown-snap-gnu)
ARC="amd64" ARC="amd64"
@ -314,8 +329,8 @@ case $BUILD_PLATFORM in
snapcraft push "parity_"$VER"_amd64.snap" snapcraft push "parity_"$VER"_amd64.snap"
snapcraft status parity snapcraft status parity
snapcraft logout snapcraft logout
md5sum "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.md5" $MD5_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.md5"
sha256sum "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256" $SHA256_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256"
echo "add artifacts to archive" echo "add artifacts to archive"
rm -rf parity.zip rm -rf parity.zip
zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.md5" "parity_"$VER"_amd64.snap.sha256" zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.md5" "parity_"$VER"_amd64.snap.sha256"
@ -325,8 +340,10 @@ case $BUILD_PLATFORM in
EXT="exe" EXT="exe"
S3WIN=".exe" S3WIN=".exe"
build build
sign_exe
calculate_checksums
make_exe make_exe
make_archive make_archive
push_binaries push_binaries
push_release updater_push_release
esac esac

12
scripts/gitlab-push-release.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
DATA="secret=$RELEASES_SECRET"
echo "Pushing release to Mainnet"
./scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF"
echo "Pushing release to Kovan"
./scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF"

20
scripts/safe_curl.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -eu
DATA=$1
ADDRESS=$2
CODE=$(curl -o out.txt -w '%{http_code}' --data $DATA $ADDRESS)
cat out.txt && rm out.txt
echo "\n"
if [[ $CODE -eq 200 ]]; then
echo 'Pushed to updater service.';
elif [[ $CODE -eq 202 ]]; then
echo 'Updater service ignored request.';
else
echo 'Unable to push info to updater service.';
exit 2
fi

35
util/version/Cargo.toml Normal file
View File

@ -0,0 +1,35 @@
# NOTE This file is used by the auto-updater service.
# Make sure to update the service if it's moved or the structure is changed.
[package]
name = "parity-version"
# NOTE: this value is used for Parity version string (via env CARGO_PKG_VERSION)
version = "1.10.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[package.metadata]
# This versions track. Should be changed to `stable` or `beta` when on respective branches.
# Used by auto-updater and for Parity version string.
track = "nightly"
# Indicates a critical release in this track (i.e. consensus issue)
critical = false
# Latest supported fork blocks for various networks. Used ONLY by auto-updater.
[package.metadata.forks]
foundation = 4370000
ropsten = 10
kovan = 5067000
[dependencies]
ethcore-bytes = { path = "../bytes" }
rlp = { path = "../rlp" }
target_info = "0.1"
[build-dependencies]
vergen = "0.1"
rustc_version = "0.2.0"
toml = "0.4"
[features]
final = []