File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ .PHONY : version-bump
2+
3+ # usage: > type=patch make version-bump
4+ # usage: > type=minor make version-bump
5+ # usage: > type=major make version-bump
6+ version-bump :
7+ set -e; \
8+ if [ " $( type) " = " patch" ] || [ " $( type) " = " minor" ] || [ " $( type) " = " major" ]; then \
9+ default_branch=$$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' ) ; \
10+ git checkout $$ default_branch; \
11+ git pull origin $$ default_branch; \
12+ new_version=$$(npx semver -i $(type ) $$(jq -r .version package.json ) ) ; \
13+ branch_name=" $$ default_branch-bump-version-to-$$ new_version" ; \
14+ git checkout -b $$ branch_name; \
15+ jq " .version = \" $$ new_version\" " package.json > temp.json && mv temp.json package.json; \
16+ sed -i " s/^appVersion: .*/appVersion: '$$ new_version'/" indexer/chart/Chart.yaml; \
17+ sed -i " s/^appVersion: .*/appVersion: '$$ new_version'/" processor-chart/Chart.yaml; \
18+ git add processor-chart/Chart.yaml indexer/chart/Chart.yaml package.json ; \
19+ git commit -m " Bump version to $$ new_version" ; \
20+ else \
21+ echo " Invalid version type. Please use patch, minor, or major." ; \
22+ fi
You can’t perform that action at this time.
0 commit comments