Skip to content

Commit

Permalink
update release script
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Sakai committed May 23, 2018
1 parent baab72a commit a33ac41
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@


# input release version
echo -e "\n>> Start Github Release:"
PACKAGE_NAME=`node -pe 'require("./package.json").name'`
echo Github Release: $PACKAGE_NAME
read -p "[? release version (for example: 1.0.0): " RELEASE_VERSION
echo -e ">> Package name: ${PACKAGE_NAME}"
CURRENT_VERSION=`grep -o -e "\"version\".*$" package.json | sed -e "s/\"version\": \"\(.*\)\".*$/\1/"`
read -p "[? release version (for current: ${CURRENT_VERSION}): " RELEASE_VERSION
[ -z "$RELEASE_VERSION" ] && exit


Expand All @@ -33,11 +35,12 @@ echo -e "\n>> Check unity editor... ${UNITY_VER} (${UNITY_EDITOR})"
echo -e ">> OK"

# generate change log
echo -e "\n>> Generate change log..."
CHANGELOG_GENERATOR_ARG=`grep -o -e ".*git\"$" package.json | sed -e "s/^.*\/\([^\/]*\)\/\([^\/]*\).git.*$/--user \1 --project \2/"`
echo -e "\n>> Generate change log... ${CHANGELOG_GENERATOR_ARG}"
TAG=v$RELEASE_VERSION
git tag $TAG
git push --tags
github_changelog_generator
github_changelog_generator ${CHANGELOG_GENERATOR_ARG}
git tag -d $TAG
git push --delete origin $TAG

Expand All @@ -46,13 +49,6 @@ read -p "[? is the change log correct? (y/N):" yn
case "$yn" in [yY]*) ;; *) exit ;; esac


# export unitypackage
PACKAGE_SRC=`node -pe 'require("./package.json").src'`
echo -e "\n>> Export unitypackage... ${PACKAGE_SRC}"
"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`" -exportpackage "$PACKAGE_SRC" "$PACKAGE_NAME.unitypackage"
echo -e ">> OK"


# commit release files
echo -e "\n>> Commit release files..."
git add CHANGELOG.md -f
Expand All @@ -71,6 +67,13 @@ git merge --ff master
git push origin develop


# export unitypackage
PACKAGE_SRC=`node -pe 'require("./package.json").src'`
echo -e "\n>> Export unitypackage... ${PACKAGE_SRC}"
"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`" -exportpackage "$PACKAGE_SRC" "$PACKAGE_NAME.unitypackage"
echo -e ">> OK"


# upload unitypackage and release on Github
gh-release --assets "$PACKAGE_NAME.unitypackage"

Expand Down

0 comments on commit a33ac41

Please sign in to comment.