forked from x-motemen/ghq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (23 loc) · 770 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
GO = go
VERBOSE_FLAG = $(if $(VERBOSE),-v)
VERSION = $$(git describe --tags --always --dirty) ($$(git name-rev --name-only HEAD))
BUILD_FLAGS = -ldflags "\
-X \"main.Version=$(VERSION)\" \
"
build: deps
$(GO) build $(VERBOSE_FLAG) $(BUILD_FLAGS)
test: testdeps
$(GO) test $(VERBOSE_FLAG) $($(GO) list ./... | grep -v '^github.com/motemen/ghq/vendor/')
deps:
$(GO) get -d $(VERBOSE_FLAG)
testdeps:
$(GO) get -d -t $(VERBOSE_FLAG)
install: deps
$(GO) install $(VERBOSE_FLAG) $(BUILD_FLAGS)
bump-minor:
git diff --quiet && git diff --cached --quiet
new_version=$$(gobump minor -w -r -v) && \
test -n "$$new_version" && \
git commit -a -m "bump version to $$new_version" && \
git tag v$$new_version
.PHONY: build test deps testdeps install