forked from yezihack/github-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (39 loc) · 1.25 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
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
name=github-webhook
VERSION=1.5.0
dev:run
fmt:
gofmt -l -w ./
build:clean fmt
go build -ldflags="-s -w" -o bin/test/${name} .
clean:
rm -rf bin/test/*
run:build
bin/test/${name}
cover:
go test -cover
file:
go test -v -covermode=count -coverprofile=${OUT}
func:file
go tool cover -func=${OUT}
html:file
go tool cover -html=${OUT} -o ${OUT}.html
goveralls:
${GOPATH}/bin/goveralls -coverprofile=${OUT} -service=travis-ci -repotoken ${COVERALLS_TOKEN}
linux:fmt
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o bin/linux/${name} .
window:fmt
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -ldflags="-s -w" -o bin/window/${name}.exe .
mac:fmt
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -ldflags="-s -w" -o bin/mac/${name} .
clear:
rm -rf bin/window
rm -rf bin/linux
rm -rf bin/mac
rm -rf bin/tar
tar:clear linux window mac clear
mkdir -p bin/tar
tar -czvf bin/tar/${name}$(VERSION).window-amd64.tar.gz -C bin/window ${name}.exe
tar -czvf bin/tar/${name}$(VERSION).linux-amd64.tar.gz -C bin/linux ${name}
tar -czvf bin/tar/${name}$(VERSION).darwin-amd64.tar.gz -C bin/mac ${name}
.PHONY:fmt build clean run dev window linux mac clear tar