mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 18:37:59 +00:00
check spec_version and impl_version (#1743)
This commit is contained in:
committed by
Gav Wood
parent
e5dbcf6890
commit
810c391de2
@@ -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')"
|
||||
|
||||
|
||||
# see if the spec 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}" ]
|
||||
then
|
||||
cat <<-EOT
|
||||
# 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")"
|
||||
|
||||
changes to the runtime sources and changes in the spec version and wasm
|
||||
binary blob.
|
||||
|
||||
# see if the version and the binary blob changed
|
||||
if git diff --name-only origin/master...${CI_COMMIT_SHA} \
|
||||
| grep -q "${RUNTIME}" && \
|
||||
[ "${add_version}" != "${sub_version}" ]
|
||||
then
|
||||
cat <<-EOT
|
||||
|
||||
changes to the runtime sources and changes in the spec version and wasm
|
||||
binary blob.
|
||||
|
||||
${version}: ${sub_version} -> ${add_version}
|
||||
|
||||
EOT
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
spec_version: ${sub_spec_version} -> ${add_spec_version}
|
||||
|
||||
EOT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user