Skip to content

Commit

Permalink
Produce zip archives for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
tintoy committed Feb 18, 2018
1 parent cc38252 commit 69cc110
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
EXECUTABLE_NAME=vault2env
VERSION = 0.0.1
VERSION_INFO_FILE = ./$(PROVIDER_NAME)/version-info.go

BIN_DIRECTORY = _bin
EXECUTABLE_NAME = vault2env
DIST_ZIP_PREFIX = $(EXECUTABLE_NAME).v$(VERSION)

REPO_BASE = github.com/DimensionDataResearch
REPO_ROOT = $(REPO_BASE)/vault2env

default: dev

Expand All @@ -7,17 +15,28 @@ fmt:

clean:
rm -rf ./_bin
go clean $(REPO_ROOT)/...

# Peform a development (current-platform-only) build.
dev: fmt
go build -o _bin/${EXECUTABLE_NAME}

build: fmt build_linux_amd64 build_darwin_amd64 build_windows_amd64

build_linux_amd64:
GOOS=linux GOARCH=amd64 go build -o _bin/${EXECUTABLE_NAME}
GOOS=linux GOARCH=amd64 go build -o _bin/linux-amd64/${EXECUTABLE_NAME}

build_darwin_amd64:
GOOS=darwin GOARCH=amd64 go build -o _bin/${EXECUTABLE_NAME}
GOOS=darwin GOARCH=amd64 go build -o _bin/darwin-amd64/${EXECUTABLE_NAME}

build_windows_amd64:
GOOS=windows GOARCH=amd64 go build -o _bin/${EXECUTABLE_NAME}.exe
GOOS=windows GOARCH=amd64 go build -o _bin/windows-amd64/${EXECUTABLE_NAME}.exe

# Produce archives for a GitHub release.
dist: build
cd $(BIN_DIRECTORY)/windows-amd64 && \
zip -9 ../$(DIST_ZIP_PREFIX).windows-amd64.zip $(EXECUTABLE_NAME).exe
cd $(BIN_DIRECTORY)/linux-amd64 && \
zip -9 ../$(DIST_ZIP_PREFIX).linux-amd64.zip $(EXECUTABLE_NAME)
cd $(BIN_DIRECTORY)/darwin-amd64 && \
zip -9 ../$(DIST_ZIP_PREFIX)-darwin-amd64.zip $(EXECUTABLE_NAME)

0 comments on commit 69cc110

Please sign in to comment.