-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.04 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# serpapi-golang release package
#
version=`grep VERSION serpapi.go | cut -d'"' -f2`
.PHONY: test oobt
all: version lint test doc ready
# lint source code using go tools
lint:
go vet .
go fmt .
# run integration test suite
test:
go test -v ./test
# Ruby must be installed (ERB is located under $GEM_HOME/bin or under Ruby installation)
readme:
erb -T '-' README.md.erb > README.md
# create documentation
doc: readme
go doc
# check that everything is pushed
ready:
@echo "check if repository has changes"
git status | grep "Nothing"
# out of box testing
# validate the pre-released library
oobt:
mkdir -p /tmp/oobt
cp oobt/demo.go /tmp/oobt
cd /tmp/oobt ; \
go mod init serpapi.com/golang/oobt ; \
go get -u github.com/serpapi/serpapi-golang ; \
go run demo.go
# show current version for golang and library
version:
@echo "golang: " `go --version`
@echo "current version: ${version}"
# display the current release information
release: oobt version
git tag -a ${version}
git push origin ${version}
@echo "create release: ${version}"