From 0be712c36382b33c24a0460babaa963707b14107 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 25 Jul 2025 16:49:58 +0100 Subject: [PATCH] chore: Verify version of the binary on release (#2365) --- .github/workflows/build_and_test.yml | 6 ++++++ .github/workflows/build_impl.yml | 20 ++++++++++++++++++++ .github/workflows/release.yml | 1 + 3 files changed, 27 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d8ce3740..3963b3e0 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -57,6 +57,12 @@ on: type: string default: all + expected_version: + description: Expected version of the clio_server binary + required: false + type: string + default: "" + jobs: build: uses: ./.github/workflows/build_impl.yml diff --git a/.github/workflows/build_impl.yml b/.github/workflows/build_impl.yml index 0d8dc0ce..c9db2392 100644 --- a/.github/workflows/build_impl.yml +++ b/.github/workflows/build_impl.yml @@ -53,6 +53,12 @@ on: required: true type: boolean + expected_version: + description: Expected version of the clio_server binary + required: false + type: string + default: "" + secrets: CODECOV_TOKEN: required: false @@ -183,6 +189,20 @@ jobs: if: ${{ inputs.code_coverage }} uses: ./.github/actions/code_coverage + - name: Verify expected version + if: ${{ inputs.expected_version != '' }} + run: | + EXPECTED_VERSION="clio-${{ inputs.expected_version }}" + if [[ ! -f build/clio_server ]]; then + echo "clio_server binary not found" + exit 1 + fi + actual_version=$(./build/clio_server --version) + if [[ "$actual_version" != "$EXPECTED_VERSION" ]]; then + echo "Expected version '$EXPECTED_VERSION', but got '$actual_version'" + exit 1 + fi + # `codecov/codecov-action` will rerun `gcov` if it's available and build directory is present # To prevent this from happening, we run this action in a separate workflow # diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6156d3e4..a04e85da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,7 @@ jobs: run_integration_tests: true upload_clio_server: true disable_cache: true + expected_version: ${{ github.event_name == 'push' && github.ref_name || '' }} release: needs: build-and-test