-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
474c7c6
commit 883894b
Showing
1 changed file
with
22 additions
and
0 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,22 @@ | ||
.PHONY: version-bump | ||
|
||
# usage: > type=patch make version-bump | ||
# usage: > type=minor make version-bump | ||
# usage: > type=major make version-bump | ||
version-bump: | ||
set -e; \ | ||
if [ "$(type)" = "patch" ] || [ "$(type)" = "minor" ] || [ "$(type)" = "major" ]; then \ | ||
default_branch=$$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'); \ | ||
git checkout $$default_branch; \ | ||
git pull origin $$default_branch; \ | ||
new_version=$$(npx semver -i $(type) $$(jq -r .version package.json)); \ | ||
branch_name="$$default_branch-bump-version-to-$$new_version"; \ | ||
git checkout -b $$branch_name; \ | ||
jq ".version = \"$$new_version\"" package.json > temp.json && mv temp.json package.json; \ | ||
sed -i "s/^appVersion: .*/appVersion: '$$new_version'/" indexer/chart/Chart.yaml; \ | ||
sed -i "s/^appVersion: .*/appVersion: '$$new_version'/" processor-chart/Chart.yaml; \ | ||
git add processor-chart/Chart.yaml indexer/chart/Chart.yaml package.json ; \ | ||
git commit -m "Bump version to $$new_version"; \ | ||
else \ | ||
echo "Invalid version type. Please use patch, minor, or major."; \ | ||
fi |