From 7d969620e8cfae3b78c155d74bb1ee3ccde34e69 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:22:54 +0200 Subject: [PATCH] build: minor build script improvements --- README.md | 5 ++++- abci/README.md | 6 ++---- scripts/release.sh | 26 +++++++++++++++++++++++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5052e7c3..0e9b8b73 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,10 @@ The repository contains the following crates: ## Version Compatibility -The major and minor versions of this library are designed to match those of [Tenderdash]. For instance, if you're working with `Tenderdash 1.2.34`, you should use `rs-tenderdash-abci 1.2.*` to ensure compatibility. +Versioning of this library follows the Semantic Versioning 2.0.0 specification. Specifically, it consists of +`MAJOR.MINOR.PATCH+BUILD`, where `BUILD` denotes minimum version of [Tenderdash] required. + +For instance, if you're working with `Tenderdash 1.3.0`, you should use `rs-tenderdash-abci 1.2.0+1.3.0`. This library also includes built-in support for ABCI protocol version verification. The ABCI protocol version, as defined in Tenderdash's [version.go](https://github.com/dashpay/tenderdash/blob/HEAD/version/version.go) under the `ABCISemVer` constant, must align with the ABCI protocol version of this library. You can find the library's ABCI protocol version in [proto/src/tenderdash.rs](proto/src/tenderdash.rs) under the `ABCI_VERSION` constant. diff --git a/abci/README.md b/abci/README.md index 48048990..e7118830 100644 --- a/abci/README.md +++ b/abci/README.md @@ -1,4 +1,4 @@ -## tendermint-abci +# tendermint-abci [![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] @@ -85,9 +85,7 @@ Copyright © 2021 Informal Systems Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 +You may obtain a copy of the License at . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/scripts/release.sh b/scripts/release.sh index e0d45349..1a7f17a1 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,5 +1,7 @@ #! /bin/bash +set -e + PLATFORM_DIR="$(realpath "$(dirname "$0")/../../platform")" function help() { @@ -26,6 +28,8 @@ Examples: EOF } +VERBOSE=0 + # Parse arguments while [[ $# -gt 0 ]]; do key="$1" @@ -52,6 +56,10 @@ while [[ $# -gt 0 ]]; do rs_tenderdash_abci_version=$1 shift ;; + -v | --verbose) + VERBOSE=1 + shift + ;; *) break ;; @@ -61,19 +69,29 @@ done # Check if the versions are passed. if [ -z "$td_version" ]; then echo "Please specify the version of Tenderdash." + echo "" + help exit 1 fi td_version=${td_version#v} # remove 'v' if it exists if [ -z "$rs_tenderdash_abci_version" ]; then echo "Please specify the version of the library." + echo "" + help exit 1 fi -rs_tenderdash_abci_version=${rs_tenderdash_abci_version#v} # remove 'v' if it exists +if [ $VERBOSE -eq 1 ]; then + set -x +fi + +rs_tenderdash_abci_version="${rs_tenderdash_abci_version#v}+${td_version}" # remove 'v' if it exists and suffix build mtd + +echo "INFO: Preparing release of rs-tenderdash-abci version $rs_tenderdash_abci_version with Tenderdash version $td_version" + +echo INFO: Update the version in the Cargo.toml files. -set -ex -# Update the version in the Cargo.toml files. sed -i "s/^version = .*/version = \"$rs_tenderdash_abci_version\"/" ./*/Cargo.toml sed -i "s/^\s*const DEFAULT_VERSION: &str = \".*\";/const DEFAULT_VERSION: \&str = \"v$td_version\";/" ./proto/build.rs cargo fmt -- ./proto/build.rs 2>/dev/null @@ -88,3 +106,5 @@ else echo "WARN: Dash Platform not found in $PLATFORM_DIR, skipping" fi # tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "0.14.0-dev.8", features = [ + +echo "INFO: Done"