-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
3 changed files
with
28 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -22,5 +22,8 @@ jobs: | |
npm install | ||
npm ci | ||
npm test | ||
- name: release | ||
run: | | ||
npm run release | ||
env: | ||
CI: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
echo "Start Semantic Versioning release..."; | ||
echo "Checking branch..."; | ||
RELEASE_BRANCH="master"; | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); | ||
if [ $RELEASE_BRANCH != $CURRENT_BRANCH ]; then | ||
echo "A new release version is only bumped on branch: $RELEASE_BRANCH."; | ||
echo "Exiting..."; | ||
exit 0; | ||
fi | ||
PATCH_MSG="[PATCH]"; | ||
MAJOR_MSG="[MAJOR]"; | ||
echo "Parsing git message..."; | ||
COMMIT_MSG=$(git log -1 --pretty=format:"%s"); | ||
echo "Last commit message: ${COMMIT_MSG}"; | ||
if [[ $COMMIT_MSG == *"$PATCH_MSG"* ]]; then | ||
echo "Executing new PATCH release..." | ||
elif [[ $COMMIT_MSG == *"$MAJOR_MSG"* ]]; then | ||
echo "Executing new MAJOR release..." | ||
else | ||
echo "Executing new MINOR release..."; | ||
fi | ||
echo "End Semantic Versioning release."; |