diff --git a/.github/workflows/_03_release_checks.yml b/.github/workflows/_03_release_checks.yml index 43bb2a78b5..4225db381b 100644 --- a/.github/workflows/_03_release_checks.yml +++ b/.github/workflows/_03_release_checks.yml @@ -14,7 +14,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - manifest: [state-chain/node/Cargo.toml, engine/Cargo.toml, api/bin/chainflip-cli/Cargo.toml, api/bin/chainflip-broker-api/Cargo.toml, api/bin/chainflip-lp-api/Cargo.toml] + manifest: + - state-chain/node/Cargo.toml + - engine/Cargo.toml + - api/bin/chainflip-cli/Cargo.toml + - api/bin/chainflip-broker-api/Cargo.toml + - api/bin/chainflip-lp-api/Cargo.toml + - state-chain/runtime/Cargo.toml steps: - name: Checkout 🏁 uses: actions/checkout@v3 @@ -62,3 +68,13 @@ jobs: - name: Check changelog 📝 shell: bash run: ./ci/scripts/check_changelog.sh ${{ inputs.tag }} + + check-runtime-spec-version: + runs-on: ubuntu-latest + steps: + - name: Checkout 🏁 + uses: actions/checkout@v3 + + - name: Check changelog 📝 + shell: bash + run: ./ci/scripts/check_runtime_spec_version.sh ${{ inputs.tag }} diff --git a/ci/scripts/check_runtime_spec_version.sh b/ci/scripts/check_runtime_spec_version.sh new file mode 100755 index 0000000000..708cedbfe6 --- /dev/null +++ b/ci/scripts/check_runtime_spec_version.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +version=$1 +runtime_spec_version_file="state-chain/runtime/src/lib.rs" +numeric_version=$(echo $version | tr -d '.') + +# Extract the spec_version from the Rust file +spec_version=$(grep 'spec_version:' $runtime_spec_version_file | awk '{print $2}' | tr -d ',') + +runtime_version=$(cargo read-manifest --manifest-path state-chain/runtime/Cargo.toml | jq -r .version) + +# Compare versions +if [ "$spec_version" != "$numeric_version" ]; then + echo "Error: spec_version ($spec_version) does not match the expected version ($numeric_version)" + exit 1 +fi + +if [ "$runtime_version" != "$version" ]; then + echo "Error: runtime version ($runtime_version) does not match the expected version ($version)" + exit 1 +fi