bin/release: also check git tags for current version.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
This commit is contained in:
Jacob Kiers 2014-05-05 16:16:51 +02:00
parent cfd3316811
commit 7d4c9b54e7

View File

@ -45,6 +45,7 @@ fi
jq_ver=$(find . -maxdepth 1 -name "*.jquery.json" | xargs cat | jq -r ".version") jq_ver=$(find . -maxdepth 1 -name "*.jquery.json" | xargs cat | jq -r ".version")
cmpnt_ver=$(find . -maxdepth 1 -name "bower.json" | xargs cat | jq -r ".version") cmpnt_ver=$(find . -maxdepth 1 -name "bower.json" | xargs cat | jq -r ".version")
pkg_ver=$(find . -maxdepth 1 -name "package.json" | xargs cat | jq -r ".version") pkg_ver=$(find . -maxdepth 1 -name "package.json" | xargs cat | jq -r ".version")
git_ver=$(git tag | sort -rV | head -n1)
# Non npm package # Non npm package
[ "$pkg_ver" == "0.0.0" ] && pkg_ver= [ "$pkg_ver" == "0.0.0" ] && pkg_ver=
@ -54,6 +55,7 @@ current_ver=
[ -n "$jq_ver" ] && current_ver="$jq_ver" [ -n "$jq_ver" ] && current_ver="$jq_ver"
[ -n "$cmpnt_ver" ] && current_ver="$cmpnt_ver" [ -n "$cmpnt_ver" ] && current_ver="$cmpnt_ver"
[ -n "$pkg_ver" ] && current_ver="$pkg_ver" [ -n "$pkg_ver" ] && current_ver="$pkg_ver"
[ -n "$git_ver" ] && current_ver="$git_ver"
[ -z "$current_ver" ] && current_ver="0.0.0" [ -z "$current_ver" ] && current_ver="0.0.0"
# Validate current versions and determine new version # Validate current versions and determine new version
@ -103,11 +105,11 @@ if [ -f src/Gruntfile.js ]; then
fi fi
# Commit changed files # Commit changed files
git commit -am "v$new_ver" git commit -am "$new_ver"
git push origin git push origin
# Create tag # Create tag
git tag "v$new_ver" git tag "$new_ver"
git push origin --tags git push origin --tags
# Publish npm package # Publish npm package