This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
393 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Update hotfix" | ||
|
||
OPT=$1 | ||
|
||
## Check branch | ||
checkBranch() { | ||
BRANCH=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD) | ||
if [ $BRANCH != "dev" ]; then | ||
echo "Error" | ||
echo "You must be on dev branch" | ||
exit 1 | ||
fi | ||
} | ||
|
||
## Merge hotfix | ||
merge() { | ||
git pull | ||
git checkout hotfix | ||
git pull | ||
git checkout dev | ||
git merge hotfix | ||
} | ||
|
||
## Check | ||
check() { | ||
rm yarn.lock | ||
./.github/workflows/check.sh | ||
} | ||
|
||
## Release | ||
release() { | ||
if [ "$OPT" = "release" ]; then | ||
# package.json version | ||
PACKAGE_VERSION=$(cat package.json | jq -r '.version') | ||
echo $PACKAGE_VERSION | ||
NUMS=(${PACKAGE_VERSION//./ }) | ||
|
||
# Increse minor | ||
((NUMS[2]++)) | ||
PACKAGE_NEW_VERSION=${NUMS[0]}.${NUMS[1]}.${NUMS[2]} | ||
echo $PACKAGE_NEW_VERSION | ||
|
||
# New package.json version | ||
jq ".version=\"${PACKAGE_NEW_VERSION}\"" package.json >/tmp/package.json | ||
mv /tmp/package.json package.json | ||
|
||
# release | ||
./.github/release.sh $PACKAGE_NEW_VERSION | ||
else | ||
git add . | ||
git commit -m"update" | ||
git push | ||
git checkout hotfix | ||
git merge dev | ||
git push | ||
git checkout dev | ||
fi | ||
} | ||
|
||
checkBranch | ||
merge | ||
check | ||
release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.