-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 1.03 KB
/
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
GHK ?= 'github-key'
TRAVIS_BUILD_NUMBER ?= 2
TRAVIS_COMMIT ?= $(shell git log --format=\%H -1)
SLUG=libgolang/props
build:
go build
check: $(GOPATH)/bin/deadcode $(GOPATH)/bin/errcheck $(GOPATH)/bin/golint
# Run Code Tests
go vet
errcheck
golint
deadcode
unit-test:
go test
deploy:
$(eval VERSION = v$(shell cat VERSION).$(TRAVIS_BUILD_NUMBER))
@echo curl -d '{ "tag_name": "$(VERSION)", "target_commitish": "$(TRAVIS_COMMIT)", "name": "$(VERSION)", "body": "Automatic Release of $(VERSION)", "draft": false, "prerelease": false }' "https://api.github.com/repos/$(SLUG)/releases"
@curl -f -H "Authorization: Bearer $(GHK)" -d '{ "tag_name": "$(VERSION)", "target_commitish": "$(TRAVIS_COMMIT)", "name": "$(VERSION)", "body": "Automatic Release of $(VERSION)", "draft": false, "prerelease": false }' "https://api.github.com/repos/$(SLUG)/releases"
$(GOPATH)/bin/deadcode:
go get -u github.com/tsenart/deadcode
$(GOPATH)/bin/errcheck:
go get -u github.com/kisielk/errcheck
$(GOPATH)/bin/golint:
go get -u golang.org/x/lint/golint