-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
52 lines (39 loc) · 1.01 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
PKG = github.com/k1LoW/gh-grep
COMMIT = $$(git describe --tags --always)
OSNAME=${shell uname -s}
ifeq ($(OSNAME),Darwin)
DATE = $$(gdate --utc '+%Y-%m-%d_%H:%M:%S')
else
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
endif
export GO111MODULE=on
export CGO_ENABLED=0
BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
default: test
ci: depsdev test
test:
go test ./... -coverprofile=coverage.out -covermode=count
lint:
golangci-lint run ./...
test-setup:
./gh-grep --help
build:
go build -ldflags="$(BUILD_LDFLAGS)" -o ghgrep
depsdev:
go install github.com/Songmu/ghch/cmd/ghch@latest
go install github.com/Songmu/gocredits/cmd/gocredits@latest
prerelease:
git pull origin main --tag
go mod tidy
ghch -w -N ${VER}
gocredits -w .
git add CHANGELOG.md CREDITS go.mod go.sum gh-grep
git commit -m'Bump up version number'
git tag ${VER}
prerelease_for_tagpr:
gocredits -w .
git add CHANGELOG.md CREDITS go.mod go.sum
release:
git push origin main --tag
goreleaser --clean
.PHONY: default test