Skip to content

Commit

Permalink
build(Makefile): add release func
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Jun 30, 2020
1 parent 6151365 commit f97a417
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ UI_VERSION=$(shell cat web/bore-landing/package.json | grep version | head -1 |
VERSION_PATH=github.com/jkuri/bore/internal/version
GIT_COMMIT=$(shell git rev-list -1 HEAD)
BUILD_DATE=$(shell date +%FT%T%z)
RELEASE_DIR=build/release
OS="darwin freebsd linux windows"
ARCH="amd64 arm"
OSARCH="!darwin/arm !windows/arm"

build: statik_landing wire build_server build_client

Expand All @@ -21,9 +25,12 @@ statik_landing: build_ui_landing
@if [ ! -r "internal/ui/landing/statik.go" ]; then statik -dest ./internal/ui -p landing -src ./web/bore-landing/dist; fi

install_dependencies:
@go get github.com/jkuri/statik github.com/google/wire/cmd/...
@go get github.com/jkuri/statik github.com/google/wire/cmd/... github.com/mitchellh/gox

clean:
@rm -rf build/ internal/ui web/bore-landing/dist

.PHONY: wire build_server build_client build build_ui_landing statik_landing clean
release: statik_landing wire
@gox -os=${OS} -arch=${ARCH} -osarch=${OSARCH} -output "${RELEASE_DIR}/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X ${VERSION_PATH}.GitCommit=${GIT_COMMIT} -X ${VERSION_PATH}.UIVersion=${UI_VERSION} -X ${VERSION_PATH}.BuildDate=${BUILD_DATE}" ./cmd/bore ./cmd/bore-server

.PHONY: wire build_server build_client build build_ui_landing statik_landing clean release

0 comments on commit f97a417

Please sign in to comment.