-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (72 loc) · 1.5 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
PKG := github.com/ChrisWiegman/gh-backup
VERSION := $(shell git describe --tags || echo "0.0.1")
TIMESTAMP := $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
.PHONY: change
change:
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
new
.PHONY: changelog
changelog:
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
batch $(call ARGS,defaultstring)
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
merge
.PHONY: clean
clean:
rm -rf \
dist \
vendor
.PHONY: install
install:
go mod vendor
go install \
-ldflags "-s -w -X $(PKG)/internal/backup.Version=$(VERSION) -X $(PKG)/internal/backup.Timestamp=$(TIMESTAMP)" \
./cmd/...
.PHONY: lint
lint:
@if [ ! -f $GOPATH/bin/gilangci-lint ]; then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest;\
fi
@golangci-lint \
run
.PHONY: snapshot
snapshot:
docker run --rm \
--privileged \
-v $(PWD):/go/src/$(PKG) \
-w /go/src/$(PKG) \
goreleaser/goreleaser \
release \
--clean \
--release-notes=./.changes/$(VERSION).md \
--snapshot
.PHONY: test
test:
go \
test \
-v \
-timeout 30s\
-cover \
./...
.PHONY: update
update:
go get -u ./...