Skip to content

Commit

Permalink
improve Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed May 2, 2023
1 parent ed2169b commit 6258337
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6258337

Please sign in to comment.