forked from akrennmair/gopcap
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
45 lines (36 loc) · 701 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
38
39
40
41
42
43
44
45
define GO
//+build ignore
package main
import (
"fmt"
"github.com/miekg/pcap"
)
func main() {
fmt.Println(pcap.GoVersion)
}
endef
$(file > version_release.go,$(GO))
VERSION:=$(shell go run version_release.go)
TAG="v$(VERSION)"
all:
@echo "use \'make release\' to release $(VERSION)"
rm -f version_release.go
.PHONY: test
test:
@echo "TAG" $(TAG)
@echo "VERSION" $(VERSION)
rm -f version_release.go
.PHONY: release
release: commit push
rm -f version_release.go
@echo "released $(VERSION)"
.PHONY: commit
commit:
@echo committing release $(VERSION)
git commit -am"Release $(VERSION)"
git tag $(TAG)
.PHONY: push
push:
@echo pushing $(VERSION) to GitHub
git push --tags
git push