diff --git a/go.mod b/go.mod index 0042104fdc..af5aed77cc 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( ) retract ( + v0.28.0 v0.26.0 v0.22.1 ) diff --git a/make/test-upgrade.mk b/make/test-upgrade.mk index 2c5ddd5c37..72c587d773 100644 --- a/make/test-upgrade.mk +++ b/make/test-upgrade.mk @@ -14,7 +14,8 @@ export AKASH_LOG_COLOR = true KEY_OPTS := --keyring-backend=$(AKASH_KEYRING_BACKEND) KEY_NAME ?= validator -UPGRADE_TO ?= $(shell $(ROOT_DIR)/script/upgrades.sh test-required $(RELEASE_TAG)) +#UPGRADE_TO ?= $(shell $(ROOT_DIR)/script/upgrades.sh test-required $(RELEASE_TAG)) +UPGRADE_TO ?= $(shell $(ROOT_DIR)/script/upgrades.sh upgrade-from-release $(RELEASE_TAG)) # v0.28.0 UPGRADE_FROM := $(shell cat $(ROOT_DIR)/meta.json | jq -r --arg name $(UPGRADE_TO) '.upgrades[$$name].from_version' | tr -d '\n') GENESIS_BINARY_VERSION := $(shell cat $(ROOT_DIR)/meta.json | jq -r --arg name $(UPGRADE_TO) '.upgrades[$$name].from_binary' | tr -d '\n') diff --git a/script/upgrades.sh b/script/upgrades.sh index f2f6fa1c6f..8a2e9d6838 100755 --- a/script/upgrades.sh +++ b/script/upgrades.sh @@ -307,6 +307,17 @@ init) clean) shift clean + ;; +upgrade-from-release) + shift + upgrades_dir=${ROOT_DIR}/upgrades/software + upgrade_name=$(find "${upgrades_dir}" -mindepth 1 -maxdepth 1 -type d | awk -F/ '{print $NF}' | sort -r | head -n 1) + + # shellcheck disable=SC2086 + $semver validate $upgrade_name + echo -e "$upgrade_name" + exit 0 + ;; test-required) shift