Skip to content

Commit

Permalink
upd release script.
Browse files Browse the repository at this point in the history
now it can handle the first release case. when no previous tags are
there
  • Loading branch information
makasim committed Aug 31, 2017
1 parent 864f0f3 commit 009a5c1
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,24 @@ do
git checkout $CURRENT_BRANCH;
# gsort comes with coreutils packages. brew install coreutils
LAST_RELEASE=$(git tag -l [0-9].* | gsort -V | tail -n1 )

echo "Last release $LAST_RELEASE";

CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" || -z $LAST_RELEASE]]; then
echo "There are changes since last release. Releasing $1";
if [[ -z "$LAST_RELEASE" ]]; then
echo "There has not been any releases. Releasing $1";

git tag $1 -s -m "Release $1"
git push origin --tags
else
echo "No change since last release.";
echo "Last release $LAST_RELEASE";

CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" ]]; then
echo "There are changes since last release. Releasing $1";

git tag $1 -s -m "Release $1"
git push origin --tags
else
echo "No change since last release.";
fi
fi
)
done

0 comments on commit 009a5c1

Please sign in to comment.