Skip to content

Commit

Permalink
build: remove comment based minor and major version bumps
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Biggins <sambiggins@gmail.com>
  • Loading branch information
smileynet committed Apr 2, 2023
1 parent 27df48f commit f93cf4f
Show file tree
Hide file tree
Showing 5 changed files with 2,149 additions and 4,177 deletions.
14 changes: 7 additions & 7 deletions .husky/hooks/bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# Bump version based on commit message
last_commit_message=$(git log --format=%B -n 1 HEAD)

if echo "$last_commit_message" | grep -q 'bump major'; then
# bump major version
yarn version --major --no-commit-hooks --no-git-tag-version
elif echo "$last_commit_message" | grep -q 'bump minor'; then
# bump minor version
yarn version --minor --no-commit-hooks --no-git-tag-version
elif echo "$last_commit_message" | grep -q 'bump skip'; then
if echo "$last_commit_message" | grep -q 'bump skip'; then
echo "Skipping version bump"
else
# bump patch version
yarn version --patch --no-commit-hooks --no-git-tag-version
fi

# Get the new version number
new_version=$(jq -r .version package.json)

# Create a tag with the new version number
git tag "v$new_version"

# Commit the version bump
git add package.json
4 changes: 3 additions & 1 deletion COMMITLOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## [0.1.0](https://github.com/Unnamed-GameDev-Studio/postapoc/compare/0.0.80...0.1.0) (2023-04-02)
## [0.1.2](https://github.com/Unnamed-GameDev-Studio/postapoc/compare/0.0.89...v0.1.2) (2023-04-02)

## [0.0.89](https://github.com/Unnamed-GameDev-Studio/postapoc/compare/0.0.80...0.0.89) (2023-04-02)


### Features
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postapoc",
"version": "0.1.0",
"version": "0.1.2",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand All @@ -17,7 +17,9 @@
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"commitlog": "conventional-changelog -p conventionalcommits -i COMMITLOG.md -s -r 0\n",
"index": "ctix create -p ./tsconfig.json",
"update_comments": "node .husky/hooks/add_comments.js"
"update_comments": "node .husky/hooks/add_comments.js",
"minor": "yarn version --minor",
"major": "yarn version --major"
},
"dependencies": {
"@svgdotjs/svg.js": "^3.1.2",
Expand Down Expand Up @@ -57,6 +59,7 @@
"inquirer": "^9.1.4",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jq": "^1.7.2",
"lint-staged": "^13.2.0",
"prettier": "^2.8.6",
"prettier-eslint": "^15.0.1",
Expand Down
Loading

0 comments on commit f93cf4f

Please sign in to comment.