|
2 | 2 |
|
3 | 3 | # Checking if current tag matches the package version
|
4 | 4 | current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | sed -r 's/^v//')
|
5 |
| -major=$(echo $current_tag | cut -d '.' -f1 ) |
6 |
| -minor=$(echo $current_tag | cut -d '.' -f2 ) |
| 5 | +major=$(echo $current_tag | cut -d '.' -f1) |
| 6 | +minor=$(echo $current_tag | cut -d '.' -f2) |
7 | 7 | cropped_current_tag="$major.$minor"
|
8 | 8 | file1='Cargo.toml'
|
9 | 9 | file2='README.tpl'
|
10 | 10 | file3='.code-samples.meilisearch.yaml'
|
11 | 11 | file4='README.md'
|
| 12 | +file5='./meilisearch-index-setting-macro/Cargo.toml' |
12 | 13 |
|
13 | 14 | file_tag1=$(grep '^version = ' $file1 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
|
| 15 | +file_tag_1_1=$(grep '{ path = "meilisearch-index-setting-macro", version =' $file1 | grep -Eo '[0-9]+.[0-9]+.[0-9]+') |
14 | 16 | file_tag2=$(grep 'meilisearch-sdk = ' $file2 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
|
15 | 17 | file_tag3=$(grep 'meilisearch-sdk = ' $file3 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
|
16 | 18 | file_tag4=$(grep 'meilisearch-sdk = ' $file4 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
|
17 |
| -if [ "$current_tag" != "$file_tag1" ] || [ "$current_tag" != "$file_tag2" ] || [ "$cropped_current_tag" != "$file_tag3" ] || [ "$current_tag" != "$file_tag4" ]; then |
| 19 | +file_tag5=$(grep '^version = ' $file5 | grep -Eo '[0-9]+.[0-9]+.[0-9]+') |
| 20 | +file_tag5_1=$(grep '{ path = \"..\", version =' $file5 | grep -Eo '[0-9]+.[0-9]+.[0-9]+') |
| 21 | + |
| 22 | +if [ "$current_tag" != "$file_tag1" ] || |
| 23 | + [ "$current_tag" != "$file_tag_1_1" ] || |
| 24 | + [ "$current_tag" != "$file_tag2" ] || |
| 25 | + [ "$cropped_current_tag" != "$file_tag3" ] || |
| 26 | + [ "$current_tag" != "$file_tag4" ] || |
| 27 | + [ "$current_tag" != "$file_tag5" ] || |
| 28 | + [ "$current_tag" != "$file_tag5_1" ] \ |
| 29 | + ; then |
18 | 30 | echo "Error: the current tag does not match the version in package file(s)."
|
19 | 31 | echo "$file1: found $file_tag1 - expected $current_tag"
|
| 32 | + echo "$file1: found $file_tag_1_1 - expected $current_tag" |
20 | 33 | echo "$file2: found $file_tag2 - expected $current_tag"
|
21 | 34 | echo "$file3: found $file_tag3 - expected $cropped_current_tag"
|
22 | 35 | echo "$file4: found $file_tag4 - expected $current_tag"
|
| 36 | + echo "$file5: found $file_tag5 - expected $current_tag" |
| 37 | + echo "$file5: found $file_tag5_1 - expected $current_tag" |
23 | 38 | exit 1
|
24 | 39 | fi
|
25 | 40 |
|
|
0 commit comments