From c484d2864617234807541433e75567f9ac9d0949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20Urquizar=20-=20curqui?= Date: Tue, 21 Jun 2022 10:14:17 +0200 Subject: [PATCH] Update .github/scripts/check-release.sh Co-authored-by: Tamo --- .github/scripts/check-release.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/scripts/check-release.sh b/.github/scripts/check-release.sh index 230c3234f..ea138c4d7 100644 --- a/.github/scripts/check-release.sh +++ b/.github/scripts/check-release.sh @@ -8,21 +8,18 @@ file3='meilisearch-lib/Cargo.toml' file4='meilisearch-types/Cargo.toml' file5='Cargo.lock' -file_tag1=$(grep '^version = ' $file1 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') -file_tag2=$(grep '^version = ' $file2 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') -file_tag3=$(grep '^version = ' $file3 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') -file_tag4=$(grep '^version = ' $file4 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') -file_tag5=$(grep -A 1 'name = "meilisearch-auth"' $file5 | grep version | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') -if [ "$current_tag" != "$file_tag1" ] || [ "$current_tag" != "$file_tag2" ] || [ "$current_tag" != "$file_tag3" ] || [ "$current_tag" != "$file_tag4" ] || [ "$current_tag" != "$file_tag5" ]; then - echo "Error: the current tag does not match the version in package file(s)." - echo "$file1: found $file_tag1 - expected $current_tag" - echo "$file2: found $file_tag2 - expected $current_tag" - echo "$file3: found $file_tag3 - expected $current_tag" - echo "$file4: found $file_tag4 - expected $current_tag" - echo "$file5: found $file_tag5 - expected $current_tag" - exit 1 -fi +file5=$(grep -A 1 'name = "meilisearch-auth"' $file5 | grep version) + +for file in $file1 $file2 $file3 $file4 $file5; +do + file_tag=$(grep '^version = ' $file | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') + if [ "$current_tag" != "$file_tag" ]; then + echo "Error: the current tag does not match the version in package file(s)." + echo "$file: found $file_tag - expected $current_tag" + exit 1 + fi +done echo 'OK' exit 0