Skip to content

Commit 8e6a4fa

Browse files
authored
Merge pull request #2 from liggitt/build-release
Add build-release make target
2 parents 1528cd8 + 6a9ffb7 commit 8e6a4fa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ default: build
55
build: check_go_version
66
go build -o ./bin/kubectl-check-ownerreferences $(shell ./build/print-ldflags.sh) ./
77

8+
build-release: check_go_version
9+
rm -fr ./bin
10+
mkdir -p ./bin/darwin/amd64
11+
mkdir -p ./bin/linux/amd64
12+
GOOS=darwin GOARCH=amd64 go build -trimpath -o ./bin/darwin/amd64/kubectl-check-ownerreferences $(shell ./build/print-ldflags.sh) ./
13+
GOOS=linux GOARCH=amd64 go build -trimpath -o ./bin/linux/amd64/kubectl-check-ownerreferences $(shell ./build/print-ldflags.sh) ./
14+
tar -cvzf ./bin/kubectl-check-ownerreferences-darwin-amd64.tar.gz LICENSE -C ./bin/darwin/amd64 kubectl-check-ownerreferences
15+
tar -cvzf ./bin/kubectl-check-ownerreferences-linux-amd64.tar.gz LICENSE -C ./bin/linux/amd64 kubectl-check-ownerreferences
16+
817
install: check_go_version
918
go install $(shell ./build/print-ldflags.sh) ./
1019

0 commit comments

Comments
 (0)