-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
29 lines (25 loc) · 1.09 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
NAME:=docker
BINARY=terraform-provider-${NAME}
VERSION=0.1.1
OS_ARCH=linux_amd64
.PHONY: default
default: build
.PHONY: build
build:
go build -o ${BINARY}
.PHONY: release
release:
cd bin/${VERSION}/ && \
zip -r9 ${BINARY}_${VERSION}_darwin_amd64.zip ${BINARY}_v${VERSION}_darwin_amd64 && \
zip -r9 ${BINARY}_${VERSION}_linux_amd64.zip ${BINARY}_v${VERSION}_linux_amd64 && \
zip -r9 ${BINARY}_${VERSION}_openbsd_amd64.zip ${BINARY}_v${VERSION}_openbsd_amd64 && \
zip -r9 ${BINARY}_${VERSION}_windows_amd64.zip ${BINARY}_v${VERSION}_windows_amd64 && \
sha256sum ${BINARY}_${VERSION}_*.zip > ${BINARY}_${VERSION}_SHA256SUMS && \
gpg --detach-sign ${BINARY}_${VERSION}_SHA256SUMS
.PHONY: build-release
build-release:
mkdir -p bin/${VERSION}
GOOS=darwin GOARCH=amd64 go build -o ./bin/${VERSION}/${BINARY}_v${VERSION}_darwin_amd64
GOOS=linux GOARCH=amd64 go build -o ./bin/${VERSION}/${BINARY}_v${VERSION}_linux_amd64
GOOS=openbsd GOARCH=amd64 go build -o ./bin/${VERSION}/${BINARY}_v${VERSION}_openbsd_amd64
GOOS=windows GOARCH=amd64 go build -o ./bin/${VERSION}/${BINARY}_v${VERSION}_windows_amd64