-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·32 lines (26 loc) · 1.31 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
setup:
./bin/setup.sh
APP_NAME := cbmigrate
VERSION := $(shell cat plugin.version)
build: clean
GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/linux_amd64/$(APP_NAME)
GOOS=linux GOARCH=arm64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/linux_arm64/$(APP_NAME)
GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/darwin_amd64/$(APP_NAME)
GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/darwin_arm64/$(APP_NAME)
GOOS=windows GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/windows_amd64/$(APP_NAME).exe
mkdir -p -m 777 builds/zip
zip -j builds/zip/$(APP_NAME)_$(VERSION)_linux_amd64.zip builds/bin/linux_amd64/$(APP_NAME)
zip -j builds/zip/$(APP_NAME)_$(VERSION)_linux_arm64.zip builds/bin/linux_arm64/$(APP_NAME)
zip -j builds/zip/$(APP_NAME)_$(VERSION)_darwin_amd64.zip builds/bin/darwin_amd64/$(APP_NAME)
zip -j builds/zip/$(APP_NAME)_$(VERSION)_darwin_arm64.zip builds/bin/darwin_arm64/$(APP_NAME)
zip -j builds/zip/$(APP_NAME)_$(VERSION)_windows_amd64.zip builds/bin/windows_amd64/$(APP_NAME).exe
clean:
rm -rf builds/*
test:
go test ./... -coverprofile=coverage.out
fmt:
go fmt ./...
gog:
go generate ./...
lint:
golangci-lint run --config=.golangci.yml