From ab2adba183ef26b7bb82a9ce63d3a99edba0a91a Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 15 Feb 2023 13:56:24 +0100 Subject: [PATCH] update our CI scripts accordingly --- .github/scripts/check-release.sh | 10 +++------- .github/workflows/update-cargo-toml-version.yml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/scripts/check-release.sh b/.github/scripts/check-release.sh index 2ce171459..b0b272226 100644 --- a/.github/scripts/check-release.sh +++ b/.github/scripts/check-release.sh @@ -3,7 +3,7 @@ # check_tag $current_tag $file_tag $file_name function check_tag { if [[ "$1" != "$2" ]]; then - echo "Error: the current tag does not match the version in $3: found $2 - expected $1" + echo "Error: the current tag does not match the version in Cargo.toml: found $2 - expected $1" ret=1 fi } @@ -11,12 +11,8 @@ function check_tag { ret=0 current_tag=${GITHUB_REF#'refs/tags/v'} -toml_files='*/Cargo.toml' -for toml_file in $toml_files; -do - file_tag="$(grep '^version = ' $toml_file | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')" - check_tag $current_tag $file_tag $toml_file -done +file_tag="$(grep '^version = ' Cargo.toml | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')" +check_tag $current_tag $file_tag lock_file='Cargo.lock' lock_tag=$(grep -A 1 'name = "meilisearch-auth"' $lock_file | grep version | cut -d '=' -f 2 | tr -d '"' | tr -d ' ') diff --git a/.github/workflows/update-cargo-toml-version.yml b/.github/workflows/update-cargo-toml-version.yml index 80961e878..d5838a5e8 100644 --- a/.github/workflows/update-cargo-toml-version.yml +++ b/.github/workflows/update-cargo-toml-version.yml @@ -29,7 +29,7 @@ jobs: run: | raw_new_version=$(echo $NEW_VERSION | cut -d 'v' -f 2) new_string="version = \"$raw_new_version\"" - sd '^version = "\d+.\d+.\w+"$' "$new_string" */Cargo.toml + sd '^version = "\d+.\d+.\w+"$' "$new_string" Cargo.toml - name: Build Meilisearch to update Cargo.lock run: cargo build - name: Commit and push the changes to the ${{ env.NEW_BRANCH }} branch