Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
[RELEASE] 0.9.31
Browse files Browse the repository at this point in the history
  • Loading branch information
sgarnotel committed May 30, 2023
1 parent d766eef commit 96fd151
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 719 deletions.
67 changes: 67 additions & 0 deletions .github/hotfix.sh
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
23 changes: 9 additions & 14 deletions .github/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,27 @@

echo "Start release"

if [ $# -eq 0 ]
then
if [ $# -eq 0 ]; then
echo "Error: Provide a commit description"
exit 1
fi

branch=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)

## Check
check () {
check() {
devLogs=$(git log dev -100 --oneline --pretty=format:"%H")

hotfixCommit=$(git log hotfix -1 --oneline --pretty=format:"%H")

hotfixOk=0
for devCommit in $devLogs
do
if [ "$devCommit" = "$hotfixCommit" ]
then
for devCommit in $devLogs; do
if [ "$devCommit" = "$hotfixCommit" ]; then
hotfixOk=1
fi
done

if [ $hotfixOk = 1 ]
then
if [ $hotfixOk = 1 ]; then
echo "Check passed, ready to merge"
else
echo "Error: branch mismatch"
Expand All @@ -36,9 +32,9 @@ check () {
}

## Merge
merge () {
merge() {
git add .
git commit -m"$1" --allow-empty
git commit -m"[RELEASE] $1" --allow-empty
git push

git checkout hotfix
Expand All @@ -50,8 +46,7 @@ merge () {
git push
}

if [ $branch = "dev" ]
then
if [ $branch = "dev" ]; then
# Check
check

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airthium/react-pdf-table",
"version": "0.9.30",
"version": "0.9.31",
"license": "MIT",
"homepage": "https://github.com/Airthium/react-pdf-table",
"repository": {
Expand Down

0 comments on commit 96fd151

Please sign in to comment.