diff --git a/.editorconfig b/.editorconfig index 28b112186..e47fd12f0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ trim_trailing_whitespace=true max_line_length=120 insert_final_newline=true -[.travis.yml] +[*.{yml,sh}] indent_style=space indent_size=2 tab_width=8 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab6a4a2ab..7c32b97f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,14 +18,14 @@ linux-stable: stage: build image: parity/rust:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - rustup default stable - # ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags - - scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 gcc g++ + # ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier + - scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 gcc g++ ubuntu tags: - rust-stable artifacts: @@ -36,13 +36,13 @@ linux-stable-debian: stage: build image: parity/rust-debian:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - export LIBSSL="libssl1.1 (>=1.1.0)" - - scripts/gitlab-build.sh x86_64-unknown-debian-gnu x86_64-unknown-linux-gnu amd64 gcc g++ + - scripts/gitlab-build.sh x86_64-unknown-debian-gnu x86_64-unknown-linux-gnu amd64 gcc g++ debian tags: - rust-debian artifacts: @@ -53,12 +53,12 @@ linux-centos: stage: build image: parity/rust-centos:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh x86_64-unknown-centos-gnu x86_64-unknown-linux-gnu x86_64 gcc g++ + - scripts/gitlab-build.sh x86_64-unknown-centos-gnu x86_64-unknown-linux-gnu x86_64 gcc g++ centos tags: - rust-centos artifacts: @@ -69,12 +69,12 @@ linux-i686: stage: build image: parity/rust-i686:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 gcc g++ + - scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 gcc g++ ubuntu tags: - rust-i686 artifacts: @@ -85,12 +85,12 @@ linux-armv7: stage: build image: parity/rust-armv7:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ + - scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ ubuntu tags: - rust-arm artifacts: @@ -101,12 +101,12 @@ linux-arm: stage: build image: parity/rust-arm:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ + - scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ ubuntu tags: - rust-arm artifacts: @@ -117,12 +117,12 @@ linux-aarch64: stage: build image: parity/rust-arm64:gitlab-ci only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ + - scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ ubuntu tags: - rust-arm artifacts: @@ -131,30 +131,30 @@ linux-aarch64: name: "aarch64-unknown-linux-gnu_parity" linux-snap: stage: build - image: parity/snapcraft:gitlab-ci + image: snapcore/snapcraft:stable only: - stable - beta - tags - triggers script: - - scripts/gitlab-build.sh x86_64-unknown-snap-gnu x86_64-unknown-linux-gnu amd64 gcc g++ + - scripts/gitlab-build.sh x86_64-unknown-snap-gnu x86_64-unknown-linux-gnu amd64 gcc g++ snap tags: - rust-stable artifacts: paths: - - snap/parity.zip + - parity.zip name: "stable-x86_64-unknown-snap-gnu_parity" allow_failure: true darwin: stage: build only: - - stable - beta - tags + - stable - triggers script: - - scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos gcc g++ + - scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos gcc g++ macos tags: - osx artifacts: @@ -167,12 +167,12 @@ windows: untracked: true stage: build only: - - stable - beta - tags + - stable - triggers script: - - sh scripts/gitlab-build.sh x86_64-pc-windows-msvc x86_64-pc-windows-msvc installer "" "" "" + - sh scripts/gitlab-build.sh x86_64-pc-windows-msvc x86_64-pc-windows-msvc installer "" "" windows tags: - rust-windows artifacts: @@ -182,14 +182,12 @@ windows: docker-build: stage: build only: - - stable - - beta - tags - triggers before_script: - docker info script: - - DOCKER_TAG=$CI_BUILD_REF_NAME + - if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - echo "Tag:" $DOCKER_TAG - docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - scripts/docker-build.sh $DOCKER_TAG @@ -262,8 +260,6 @@ push-release: - triggers image: parity/rust:gitlab-ci script: - - rustup default stable - - 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 + - scripts/gitlab-push-release.sh tags: - curl diff --git a/Cargo.lock b/Cargo.lock index 79c7909f1..f5a0a12f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1914,7 +1914,7 @@ dependencies = [ [[package]] name = "parity" -version = "1.9.2" +version = "1.9.3" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1962,7 +1962,7 @@ dependencies = [ "parity-rpc 1.9.0", "parity-rpc-client 1.4.0", "parity-updater 1.9.0", - "parity-version 1.9.2", + "parity-version 1.9.3", "parity-whisper 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", @@ -2010,7 +2010,7 @@ dependencies = [ "parity-hash-fetch 1.9.0", "parity-reactor 0.1.0", "parity-ui 1.9.0", - "parity-version 1.9.2", + "parity-version 1.9.3", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2158,7 +2158,7 @@ dependencies = [ "order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-reactor 0.1.0", "parity-updater 1.9.0", - "parity-version 1.9.2", + "parity-version 1.9.3", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2266,7 +2266,7 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.9.0", "parity-reactor 0.1.0", - "parity-version 1.9.2", + "parity-version 1.9.3", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2275,12 +2275,13 @@ dependencies = [ [[package]] name = "parity-version" -version = "1.9.2" +version = "1.9.3" dependencies = [ "ethcore-bytes 0.1.0", "rlp 0.2.1", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index cb6043041..50c2f41b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Parity Ethereum client" name = "parity" -version = "1.9.2" +version = "1.9.3" license = "GPL-3.0" authors = ["Parity Technologies "] build = "build.rs" diff --git a/mac/Parity.pkgproj b/mac/Parity.pkgproj index 2f60ce63a..99007c92e 100755 --- a/mac/Parity.pkgproj +++ b/mac/Parity.pkgproj @@ -462,7 +462,7 @@ OVERWRITE_PERMISSIONS VERSION - 1.9.2 + 1.9.3 UUID 2DCD5B81-7BAF-4DA1-9251-6274B089FD36 diff --git a/nsis/installer.nsi b/nsis/installer.nsi index 1498593b3..864eb9c46 100644 --- a/nsis/installer.nsi +++ b/nsis/installer.nsi @@ -10,7 +10,7 @@ !define DESCRIPTION "Fast, light, robust Ethereum implementation" !define VERSIONMAJOR 1 !define VERSIONMINOR 9 -!define VERSIONBUILD 2 +!define VERSIONBUILD 3 !define ARGS "" !define FIRST_START_ARGS "--mode=passive ui" diff --git a/scripts/aura-test.sh b/scripts/aura-test.sh index bb152beba..1cd6bf536 100755 --- a/scripts/aura-test.sh +++ b/scripts/aura-test.sh @@ -1,9 +1,12 @@ #!/bin/bash +set -e # fail on any error +set -u # treat unset variables as error + cargo build -j $(nproc) --release --features final $CARGOFLAGS git clone https://github.com/paritytech/parity-import-tests cp target/release/parity parity-import-tests/aura/parity cd parity-import-tests/aura echo "Start Aura test" -parity import blocks.rlp --chain chain.json -parity restore snap --chain chain.json +./parity import blocks.rlp --chain chain.json +./parity restore snap --chain chain.json echo "Aura test complete" diff --git a/scripts/gitlab-build.sh b/scripts/gitlab-build.sh index 6bebb85e6..798a25a1f 100755 --- a/scripts/gitlab-build.sh +++ b/scripts/gitlab-build.sh @@ -2,16 +2,18 @@ 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 +#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 PLATFORM=$2 ARC=$3 CC=$4 CXX=$5 -VER="$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")" +IDENT=$6 +VER="$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")" S3WIN="" echo "--------------------" echo "Build for platform: " $BUILD_PLATFORM +echo "Build identifier: " $IDENT echo "Cargo target: " $PLATFORM echo "CC&CXX flags: " $CC ", " $CXX echo "Architecture: " $ARC @@ -20,6 +22,14 @@ echo "Parity version: " $VER echo "Branch: " $CI_BUILD_REF_NAME 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 () { echo "Set ENVIROMENT" export HOST_CC=gcc @@ -50,21 +60,34 @@ build () { echo "Build ethkey-cli:" cargo build --target $PLATFORM --release -p ethkey-cli } -strip_md5 () { +strip_binaries () { echo "Strip binaries:" $STRIP_BIN -v target/$PLATFORM/release/parity $STRIP_BIN -v target/$PLATFORM/release/parity-evm $STRIP_BIN -v target/$PLATFORM/release/ethstore $STRIP_BIN -v target/$PLATFORM/release/ethkey; - export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h) +} +calculate_checksums () { echo "Checksum calculation:" + rhash --version rm -rf *.md5 - export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h) - echo "Parity file SHA3:" $SHA3 - md5sum target/$PLATFORM/release/parity > parity.md5 - md5sum target/$PLATFORM/release/parity-evm > parity-evm.md5 - md5sum target/$PLATFORM/release/ethstore > ethstore.md5 - md5sum target/$PLATFORM/release/ethkey > ethkey.md5 + rm -rf *.sha256 + + export SHA3="$($SHA3_BIN target/$PLATFORM/release/parity$S3WIN)" + # NOTE rhash 1.3.1 doesnt support keccak, workaround + if [ "$SHA3" == "%{sha3-256}" ]; then + export SHA3="$(target/$PLATFORM/release/parity$S3WIN tools hash target/$PLATFORM/release/parity$S3WIN)" + fi + + echo "Parity file SHA3: $SHA3" + $MD5_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.md5 + $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 () { rm -rf deb @@ -98,8 +121,9 @@ make_deb () { cp target/$PLATFORM/release/parity-evm deb/usr/bin/parity-evm cp target/$PLATFORM/release/ethstore deb/usr/bin/ethstore cp target/$PLATFORM/release/ethkey deb/usr/bin/ethkey - dpkg-deb -b deb "parity_"$VER"_"$ARC".deb" - md5sum "parity_"$VER"_"$ARC".deb" > "parity_"$VER"_"$ARC".deb.md5" + dpkg-deb -b deb "parity_"$VER"_"$IDENT"_"$ARC".deb" + $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" } make_rpm () { rm -rf /install @@ -108,9 +132,12 @@ make_rpm () { cp target/$PLATFORM/release/parity-evm /install/usr/bin/parity-evm cp target/$PLATFORM/release/ethstore /install/usr/bin/ethstore 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 "" --description "Ethereum network client by Parity Technologies" -C /install/ - cp "parity-"$VER"-1."$ARC".rpm" "parity_"$VER"_"$ARC".rpm" - md5sum "parity_"$VER"_"$ARC".rpm" > "parity_"$VER"_"$ARC".rpm.md5" + cp "parity-"$VER"-1."$ARC".rpm" "parity_"$VER"_"$IDENT"_"$ARC".rpm" + $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.md5" + $SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC".rpm" > "parity_"$VER"_"$IDENT"_"$ARC".rpm.sha256" } make_pkg () { echo "make PKG" @@ -123,19 +150,14 @@ make_pkg () { cd .. 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 - mv target/release/Parity\ Ethereum-signed.pkg "parity_"$VER"_"$ARC".pkg" - md5sum "parity_"$VER"_"$ARC"."$EXT >> "parity_"$VER"_"$ARC".pkg.md5" + mv target/release/Parity\ Ethereum-signed.pkg "parity_"$VER"_"$IDENT"_"$ARC".pkg" + $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT >> "parity_"$VER"_"$IDENT"_"$ARC".pkg.md5" + $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 () { - ./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 - echo "Parity file SHA3:" $SHA3 - rhash --md5 target/$PLATFORM/release/parity.exe -p %h > parity.exe.md5 - rhash --md5 target/$PLATFORM/release/parity-evm.exe -p %h > parity-evm.exe.md5 - rhash --md5 target/$PLATFORM/release/ethstore.exe -p %h > ethstore.exe.md5 - rhash --md5 target/$PLATFORM/release/ethkey.exe -p %h > ethkey.exe.md5 ./msbuild.cmd ./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe cd nsis @@ -143,9 +165,10 @@ make_exe () { echo "makensis.exe installer.nsi" > nsis.cmd ./nsis.cmd cd .. - cp nsis/installer.exe "parity_"$VER"_"$ARC"."$EXT - ./sign.cmd $keyfile $certpass "parity_"$VER"_"$ARC"."$EXT - rhash --md5 "parity_"$VER"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$ARC"."$EXT".md5" + cp nsis/installer.exe "parity_"$VER"_"$IDENT"_"$ARC"."$EXT + ./sign.cmd $keyfile $certpass "parity_"$VER"_"$IDENT"_"$ARC"."$EXT + $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" } push_binaries () { echo "Push binaries to AWS S3" @@ -160,25 +183,36 @@ push_binaries () { 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/"parity_"$VER"_"$ARC"."$EXT --body "parity_"$VER"_"$ARC"."$EXT - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$ARC"."$EXT".md5" --body "parity_"$VER"_"$ARC"."$EXT".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" } make_archive () { echo "add artifacts to archive" 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 + 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" - 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 x86_64-unknown-linux-gnu) #set strip bin @@ -186,11 +220,12 @@ case $BUILD_PLATFORM in #package extention EXT="deb" build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release + updater_push_release ;; x86_64-unknown-debian-gnu) STRIP_BIN="strip" @@ -198,86 +233,88 @@ case $BUILD_PLATFORM in LIBSSL="libssl1.1 (>=1.1.0)" echo "Use libssl1.1 (>=1.1.0) for Debian builds" build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release ;; x86_64-unknown-centos-gnu) STRIP_BIN="strip" EXT="rpm" build - strip_md5 + strip_binaries + calculate_checksums make_rpm make_archive push_binaries - push_release ;; i686-unknown-linux-gnu) STRIP_BIN="strip" EXT="deb" set_env build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release ;; armv7-unknown-linux-gnueabihf) STRIP_BIN="arm-linux-gnueabihf-strip" EXT="deb" set_env build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release ;; arm-unknown-linux-gnueabihf) STRIP_BIN="arm-linux-gnueabihf-strip" EXT="deb" set_env build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release ;; aarch64-unknown-linux-gnu) STRIP_BIN="aarch64-linux-gnu-strip" EXT="deb" set_env build - strip_md5 + strip_binaries + calculate_checksums make_deb make_archive push_binaries - push_release ;; x86_64-apple-darwin) STRIP_BIN="strip" PLATFORM="x86_64-apple-darwin" EXT="pkg" build - strip_md5 + strip_binaries + calculate_checksums make_pkg make_archive push_binaries - push_release + updater_push_release ;; x86_64-unknown-snap-gnu) ARC="amd64" EXT="snap" + apt install -y expect zip 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" = "stable" ]]; + if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.9* ]]; then - sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml; + sed -i -e 's/grade: devel/grade: beta/' snap/snapcraft.yaml; fi mv -f snap/snapcraft.yaml snapcraft.yaml snapcraft -d @@ -293,18 +330,21 @@ case $BUILD_PLATFORM in snapcraft push "parity_"$VER"_amd64.snap" snapcraft status parity snapcraft logout - md5sum "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.md5" + $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" + zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.md5" "parity_"$VER"_amd64.snap.sha256" ;; x86_64-pc-windows-msvc) set_env_win EXT="exe" S3WIN=".exe" build + sign_exe + calculate_checksums make_exe make_archive push_binaries - push_release + updater_push_release esac diff --git a/scripts/gitlab-push-release.sh b/scripts/gitlab-push-release.sh new file mode 100755 index 000000000..275576b91 --- /dev/null +++ b/scripts/gitlab-push-release.sh @@ -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" diff --git a/scripts/gitlab-test.sh b/scripts/gitlab-test.sh index d2644e528..264c3db87 100755 --- a/scripts/gitlab-test.sh +++ b/scripts/gitlab-test.sh @@ -21,11 +21,12 @@ rust_test () { rustup show if [[ "${RUST_FILES_MODIFIED}" == "0" ]]; then echo "Skipping Rust tests since no Rust files modified."; - else ./test.sh; - fi - if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]]; - then sh scripts/aura-test.sh; + 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 } js_test () { git submodule update --init --recursive diff --git a/scripts/safe_curl.sh b/scripts/safe_curl.sh new file mode 100755 index 000000000..5990d1e24 --- /dev/null +++ b/scripts/safe_curl.sh @@ -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 + diff --git a/scripts/snapcraft.yaml b/scripts/snapcraft.yaml deleted file mode 100644 index d05e6978f..000000000 --- a/scripts/snapcraft.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: parity -version: master -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. - -grade: devel -confinement: strict - -apps: - parity: - command: parity - plugs: [network, network-bind] - -parts: - parity: - source: .. - plugin: rust - build-packages: [g++, libudev-dev, libssl-dev, make, pkg-config] diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 09f501d68..fbcc562ea 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -1,10 +1,26 @@ +# 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. -version = "1.9.2" +version = "1.9.3" authors = ["Parity Technologies "] 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 = "beta" + +# 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" } @@ -13,6 +29,7 @@ target_info = "0.1" [build-dependencies] vergen = "0.1" rustc_version = "0.1.0" +toml = "0.4" [features] final = []