forked from mtulio/statuscake-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (46 loc) · 900 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
46
47
48
49
50
51
52
53
54
55
56
include Makefile-glob.mk
include Makefile-fc.mk
# Initial development
.PHONY: init
init:
go mod init
# Install all the build and lint dependencies
.PHONY: setup
setup:
go mod download
.PHONY: update
update:
go mod tidy
# Build a beta version
.PHONY: build
build:
@test -d ./bin || mkdir ./bin
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) \
go build \
-ldflags "$(LDFLAGS)" \
$(BUILD_TAGS) \
-o $(BIN_NAME) && strip $(BIN_NAME)
.PHONY: run
run:
$(BIN_NAME)
.PHONY: version
version: build
$(BIN_NAME) -v
.PHONY: clean
clean:
@rm -f bin/$(BIN_NAME)
# ##########
# Goreleaser
# https://goreleaser.com/introduction/
gorelease-init:
goreleaser init
# #######
# Release
tag:
$(call deps_tag,$@)
git tag -a $(shell cat VERSION) -m "$(message)"
git push origin $(shell cat VERSION)
# Release tool
# https://goreleaser.com/introduction/
release:
goreleaser --rm-dist