From abc22898c58f8f1a83d13e8668ba448a429164a4 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 11 May 2022 17:12:25 +0200 Subject: [PATCH] ci: check version in ci --- .github/workflows/release.yml | 2 ++ check-vsn.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60be1389..af8926f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,8 @@ jobs: - name: build release if: startsWith(github.ref, 'refs/tags/') run: | + git config --global --add safe.directory "$(pwd)" + ./check-vsn.sh make rel - uses: actions/upload-artifact@v2 diff --git a/check-vsn.sh b/check-vsn.sh index cf6a0eb4..85de70d1 100755 --- a/check-vsn.sh +++ b/check-vsn.sh @@ -2,8 +2,10 @@ set -euo pipefail +set -x + REL_VSN="$(erl -noshell -eval '{ok, C} = file:consult("rebar.config"), {_, [{release, {_Name, Vsn}, _Apps} | _]} = lists:keyfind(relx, 1, C), io:format("~s\n", [Vsn]), halt(0).')" -GIT_TAG="$(git describe --tags --exact 2>/dev/null)" +GIT_TAG="$(git describe --tags --exact)" if [ "$GIT_TAG" != '' ] && [ "$GIT_TAG" != "$REL_VSN" ]; then echo "release version does not match git tag"