forked from junkblocker/codesearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
62 lines (49 loc) · 1.31 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
BUILDS_DIR = builds
RELEASE = $(shell git tag -l | tail -1 )
.PHONY: all
all: lint vet test build install
@echo "Run $(MAKE) publish to publish to github"
.PHONY: release
release: tagcheck
@echo "Building $(RELEASE)"
goxc -bc="!plan9" -arch='amd64' -pv="$(RELEASE)" -d="$(BUILDS_DIR)" -include=LICENSE -os='darwin freebsd linux windows' go-vet go-test xc archive-zip archive-tar-gz
.PHONY: tagcheck
tagcheck:
@if [ -z "$(RELEASE)" ]; then \
echo "Could not determine tag to use. Aborting." ; \
fail ; \
fi
.PHONY: deps
deps: tagcheck
@if [ -z "$(GITHUB_TOKEN)" ]; then \
echo "GITHUB_TOKEN is not set in the environment" ; \
fail ; \
fi
go get -u github.com/tcnksm/ghr
.PHONY: publish
publish: deps
@echo "Publishing $(RELEASE) draft avoiding overwriting any older existing $(RELEASE) release"
@echo "Use $(MAKE) publish-force to force publish a non-draft $(RELEASE) release"
@ghr -soft -draft "$(RELEASE)" "$(BUILDS_DIR)/$(RELEASE)/"
.PHONY: publish-force
publish-force: deps
@echo "Force publishing $(RELEASE) to github"
@ghr "$(RELEASE)" "$(BUILDS_DIR)/$(RELEASE)/"
.PHONY: build
build:
@go build ./...
.PHONY: lint
lint:
@golint ./...
.PHONY: vet
vet:
@go vet ./...
.PHONY: test
test:
@go test -cover -race ./...
.PHONY: install
install:
@go install ./...
.PHONY: clean
clean:
rm -rf "$(BUILDS_DIR)"