Skip to content

Commit

Permalink
feat(dev-exp): bump-version target (#20)
Browse files Browse the repository at this point in the history
Makes it easier to determine next version
  • Loading branch information
karmingc authored Apr 20, 2023
1 parent 2593eee commit 8120269
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/get-next-version
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ done
version=$(./.github/scripts/get-version)

if [[ $major -gt 0 ]]; then
new_version=$(echo "${version}" | awk -F. -v OFS=. '{$1++; print}')
new_version=$(echo "${version}" | awk -F. -v OFS=. '{$1++; $2=0; $3=0; print}')
elif [[ $minor -gt 0 ]]; then
new_version=$(echo "${version}" | awk -F. -v OFS=. '{$2++; print}')
new_version=$(echo "${version}" | awk -F. -v OFS=. '{$2++; $3=0; print}')
else
new_version=$(echo "${version}" | awk -F. -v OFS=. '{$3++; print}')
fi
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.7
0.1.8
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
changelog: ## Generates a changelog with the template under ./changelog/config.yaml.
go run github.com/aaronfriel/go-change@v0.1.2 create

.PHONY: get-next-version
get-next-version: ## Gets the next version based on the current version and the changelog.
./.github/scripts/get-next-version
.PHONY: bump-version
bump-version: ## Bump the .version file to the next version with ./.github/scripts/get-next-version
echo "$$(./.github/scripts/get-next-version)" > .version


.PHONY: help
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: patch
scope: feat/developer experience,ci/cd
description: bump-version target to make it easier to determine next version.

0 comments on commit 8120269

Please sign in to comment.