diff --git a/Makefile b/Makefile index 53cbf17..5b0255f 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,11 @@ build: .PHONY: install install: - go install -ldflags=$(BUILD_LDFLAGS) ./... + go install -ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) .PHONY: show-version show-version: $(GOBIN)/gobump - @gobump show -r $(VERSION_PATH) + @gobump show -r "$(VERSION_PATH)" $(GOBIN)/gobump: @go install github.com/x-motemen/gobump/cmd/gobump@latest @@ -55,17 +55,12 @@ clean: .PHONY: bump bump: $(GOBIN)/gobump -ifneq ($(shell git status --porcelain),) - $(error git workspace is dirty) -endif -ifneq ($(shell git rev-parse --abbrev-ref HEAD),master) - $(error current branch is not master) -endif + test -z "$$(git status --porcelain || echo .)" + test "$$(git branch --show-current)" = "main" @gobump up -w "$(VERSION_PATH)" git commit -am "bump up version to $(VERSION)" git tag "v$(VERSION)" - git push origin master - git push origin "refs/tags/v$(VERSION)" + git push --atomic origin main tag "v$(VERSION)" .PHONY: upload upload: $(GOBIN)/ghr