check spec_version and impl_version
@@ -13,6 +13,7 @@ git log --graph --oneline --decorate=short -n 10
RUNTIME="node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"
+VERSIONS_FILE="node/runtime/src/lib.rs"
@@ -31,28 +32,33 @@ fi
-# check for spec_version updates
-add_spec_version="$(git diff origin/master...${CI_COMMIT_SHA} node/runtime/src/lib.rs \
- | sed -n -r 's/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p')"
-sub_spec_version="$(git diff origin/master...${CI_COMMIT_SHA} node/runtime/src/lib.rs \
- | sed -n -r 's/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p')"
+# check for version updates
+for version in spec_version impl_version
+do
+ add_version="$(git diff origin/master...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
+ | sed -n -r "s/^\+[[:space:]]+${version}: +([0-9]+),$/\1/p")"
+ sub_version="$(git diff origin/master...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
+ | sed -n -r "s/^\-[[:space:]]+${version}: +([0-9]+),$/\1/p")"
-# see if the spec version and the binary blob changed
+ # see if the version and the binary blob changed
if git diff --name-only origin/master...${CI_COMMIT_SHA} \
| grep -q "${RUNTIME}" && \
- [ "${add_spec_version}" != "${sub_spec_version}" ]
+ [ "${add_version}" != "${sub_version}" ]
then
cat <<-EOT
changes to the runtime sources and changes in the spec version and wasm
binary blob.
- spec_version: ${sub_spec_version} -> ${add_spec_version}
+ ${version}: ${sub_version} -> ${add_version}
EOT
exit 0
fi
+done
+
+
cat <<-EOT
@@ -60,6 +66,14 @@ cat <<-EOT
wasm source files changed but not the spec version and the runtime
binary blob. This may break the api.
+source file directories:
+ - node/src/runtime
+ - srml
+ - core/sr-*
+
+versions file: ${VERSIONS_FILE}
+
+
EOT
echo
