From 4233818eedd212aee07d7c3fbc56914e27d664a4 Mon Sep 17 00:00:00 2001 From: Cody Baker Date: Mon, 22 Apr 2019 23:42:24 +0200 Subject: [PATCH 1/2] bump-version: remove sembump - sembump (github.com/jessfraz/junk/sembump) is unsupported by the author and won't build on mac/windows. Make NEW_VERSION explicit. - make ... bump-version manged the low-version on the compatibility table. (cherry picked from commit fb1c08db7fb541b3807479f456306ecc811dd7e7) --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c779d240..5c13dbd8 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 @@ -19,22 +17,23 @@ all: test 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))) +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 @sed -i'' -e 's/${VERSION}/${NEW_VERSION}/g' deploy/kubernetes/releases/csi-cloudscale-${NEW_VERSION}.yaml @sed -i'' -e 's/${VERSION}/${NEW_VERSION}/g' README.md $(eval NEW_DATE = $(shell date +%Y.%m.%d)) - @sed -i'' -e 's/## unreleased/## ${NEW_VERSION} - ${NEW_DATE}/g' CHANGELOG.md + @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: @echo "==> Building the project" - @env CGO_ENABLED=0 GOOS=${OS} GOARCH=amd64 go build -o cmd/cloudscale-csi-plugin/${NAME} -ldflags "$(LDFLAGS)" ${PKG} + @env CGO_ENABLED=0 GOOS=${OS} GOARCH=amd64 go build -o cmd/cloudscale-csi-plugin/${NAME} -ldflags "$(LDFLAGS)" ${PKG} .PHONY: test From ac6c4d9fead5979fabf9fa4a537e3a43947158ea Mon Sep 17 00:00:00 2001 From: Alain Kaeslin Date: Wed, 22 Apr 2020 10:23:20 +0200 Subject: [PATCH 2/2] Update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: