Skip to content

Commit

Permalink
Makefile update (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinc authored Sep 10, 2020
1 parent d6b842e commit 721cae5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ ifeq ($(USE_GIT_VERSION),true)
else
VERSION ?= $(GIT_LAST_TAG)
endif
LFLAGS ?= -X github.com/appvia/kube-devx/pkg/${NAME}/version.Tag=${GIT_LAST_TAG} -X github.com/appvia/kube-devx/pkg/${NAME}/version.GitSHA=${GIT_SHA} -X github.com/appvia/kube-devx/pkg/${NAME}/version.Compiled=${BUILD_TIME} -X github.com/appvia/kube-devx/pkg/${NAME}/version.Release=${VERSION} -X github.com/appvia/kube-devx/pkg/${NAME}/version.GitBranch=${GIT_BRANCH}

LFLAGS ?= -X github.com/appvia/kev/pkg/${NAME}.Tag=${GIT_LAST_TAG} -X github.com/appvia/kev/pkg/${NAME}.GitSHA=${GIT_SHA} -X github.com/appvia/kev/pkg/${NAME}.Compiled=${BUILD_TIME} -X github.com/appvia/kev/pkg/${NAME}.Release=${VERSION} -X github.com/appvia/kev/pkg/${NAME}.GitBranch=${GIT_BRANCH}
CLI_PLATFORMS=darwin linux windows
CLI_ARCHITECTURES=386 amd64
export GOFLAGS = -mod=vendor
Expand All @@ -47,11 +48,11 @@ package:

package-cli:
@echo "--> Compiling CLI static binaries"
CGO_ENABLED=0 go run github.com/mitchellh/gox -parallel=4 -arch="${CLI_ARCHITECTURES}" -os="${CLI_PLATFORMS}" -ldflags "-w ${LFLAGS}" -output=./release/{{.Dir}}-cli-{{.OS}}-{{.Arch}} ./cmd/${NAME}/
CGO_ENABLED=0 gox -parallel=4 -arch="${CLI_ARCHITECTURES}" -os="${CLI_PLATFORMS}" -ldflags "-w ${LFLAGS}" -output=./release/{{.Dir}}-{{.OS}}-{{.Arch}} ./cmd/${NAME}/

push-release-packages:
@echo "--> Pushing compiled CLI binaries to draft release (requires github token set in .gitconfig or GITHUB_TOKEN env variable)"
go run github.com/tcnksm/ghr -replace -draft -n "Release ${VERSION}" "${VERSION}" ./release
ghr -replace -draft -n "Release ${VERSION}" "${VERSION}" ./release

release: build
mkdir -p release
Expand Down

0 comments on commit 721cae5

Please sign in to comment.