diff --git a/Makefile b/Makefile index f9181618..69428b0c 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,6 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) LDFLAGS ?= -X github.com/cloudscale-ch/csi-cloudscale/driver.version=${VERSION} -X github.com/cloudscale-ch/csi-cloudscale/driver.commit=${COMMIT} -X github.com/cloudscale-ch/csi-cloudscale/driver.gitTreeState=${GIT_TREE_STATE} PKG ?= github.com/cloudscale-ch/csi-cloudscale/cmd/cloudscale-csi-plugin -## Bump the version in the version file. Set BUMP to [ patch | major | minor ] -BUMP ?= patch VERSION ?= $(shell cat VERSION) all: test @@ -20,8 +18,8 @@ publish: build push clean .PHONY: bump-version bump-version: - @go get -u github.com/jessfraz/junk/sembump # update sembump tool - $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION))) + @[ "${NEW_VERSION}" ] || ( echo "NEW_VERSION must be set (ex. make NEW_VERSION=v1.x.x bump-version)"; exit 1 ) + @(echo ${NEW_VERSION} | grep -E "^v") || ( echo "NEW_VERSION must be a semver ('v' prefix is required)"; exit 1 ) @echo "Bumping VERSION from $(VERSION) to $(NEW_VERSION)" @echo $(NEW_VERSION) > VERSION @cp deploy/kubernetes/releases/csi-cloudscale-${VERSION}.yaml deploy/kubernetes/releases/csi-cloudscale-${NEW_VERSION}.yaml @@ -30,6 +28,7 @@ bump-version: $(eval NEW_DATE = $(shell date +%Y.%m.%d)) @sed -i'' -e 's/## unreleased/## ${NEW_VERSION} - ${NEW_DATE}/g' CHANGELOG.md @ echo '## unreleased\n' | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md + @rm README.md-e CHANGELOG.md-e deploy/kubernetes/releases/csi-cloudscale-${NEW_VERSION}.yaml-e .PHONY: compile compile: diff --git a/README.md b/README.md index 4cdd85e3..0898a845 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ $ KUBECONFIG=$(pwd)/kubeconfig make test-integration To release a new version bump first the version: ``` -$ make bump-version +$ make NEW_VERSION=vX.Y.Z bump-version ``` Make sure everything looks good. Create a new branch with all changes: