Skip to content

Commit

Permalink
ci: check version in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed May 11, 2022
1 parent 0cfbc71 commit abc2289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion check-vsn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit abc2289

Please sign in to comment.