forked from smartystreets/smartystreets-go-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 1010 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
34
35
36
37
#!/usr/bin/make -f
VERSION_FILE := version.go
VERSION := $(shell bumpit -p `git describe`)
test: fmt clean
go test -short -cover -count=1 ./...
fmt:
go mod tidy && go fmt ./...
clean:
@git checkout "$(VERSION_FILE)"
compile: clean
go build ./...
build: test compile
cover: compile
go test -coverprofile=coverage.out && go tool cover -html=coverage.out
integrate: compile test
@go run examples/international-street-api/main.go > /dev/null
@go run examples/us-street-api/main.go > /dev/null
@go run examples/us-autocomplete-api/main.go > /dev/null
@go run examples/us-extract-api/main.go > /dev/null
@go run examples/us-zipcode-api/main.go > /dev/null
@go run examples/us-reverse-geo-api/main.go > /dev/null
version:
printf 'package sdk\n\nconst VERSION = "%s"\n' "$(VERSION)" > "$(VERSION_FILE)"
publish: compile test version
git commit -am "Incremented version."; tagit -p; git push origin master --tags
.PHONY: test fmt clean compile build cover integrate version package publish