mirror of
https://github.com/Chipazawra/v8-1c-cluster-pde.git
synced 2025-03-25 21:29:00 +02:00
release assets
This commit is contained in:
parent
eb20b435c6
commit
70d4d252d5
8
Makefile
8
Makefile
@ -30,10 +30,8 @@ ifeq ($(DEVGO_PATH),)
|
||||
endif
|
||||
endif
|
||||
|
||||
-include $(DEVGO_PATH)/makefiles/main.mk
|
||||
-include $(DEVGO_PATH)/makefiles/lint.mk
|
||||
-include $(DEVGO_PATH)/makefiles/release-assets.mk
|
||||
-include $(DEVGO_PATH)/makefiles/build.mk
|
||||
-include $(DEVGO_PATH)/makefiles/reset-ci.mk
|
||||
|
||||
-include ./release-assets.mk
|
||||
|
||||
|
||||
# Add your custom targets here.
|
26
release-assets.mk
Normal file
26
release-assets.mk
Normal file
@ -0,0 +1,26 @@
|
||||
GO ?= go
|
||||
|
||||
# Override in app Makefile to add custom ldflags, example BUILD_LDFLAGS="-s -w"
|
||||
BUILD_LDFLAGS ?= ""
|
||||
|
||||
# Override in app Makefile to control build target, example BUILD_PKG=./cmd/my-app
|
||||
BUILD_PKG ?= .
|
||||
|
||||
# Override in app Makefile to control build artifact destination.
|
||||
BUILD_DIR ?= ./bin
|
||||
|
||||
export CGO_ENABLED ?= 0
|
||||
|
||||
RELEASE_TARGETS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 linux/arm32 windows/amd64
|
||||
|
||||
## Build and compress binaries for release assets.
|
||||
release-assets:
|
||||
@echo "Release targets: $(RELEASE_TARGETS)"
|
||||
@[[ $(RELEASE_TARGETS) == *"darwin/amd64"* ]] && (echo "Building Darwin AMD64 binary" && GOOS=darwin GOARCH=amd64 $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && tar zcvf ../darwin_amd64.tar.gz * && rm *) || :
|
||||
@[[ $(RELEASE_TARGETS) == *"darwin/arm64"* ]] && (echo "Building Darwin ARM64 binary" && GOOS=darwin GOARCH=arm64 $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && tar zcvf ../darwin_arm64.tar.gz * && rm *) || :
|
||||
@[[ $(RELEASE_TARGETS) == *"linux/amd64"* ]] && (echo "Building Linux AMD64 binary" && GOOS=linux GOARCH=amd64 $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && tar zcvf ../linux_amd64.tar.gz * && rm *) || :
|
||||
@[[ $(RELEASE_TARGETS) == *"linux/arm64"* ]] && (echo "Building Linux ARM64 binary" && GOOS=linux GOARCH=arm64 $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && tar zcvf ../linux_arm64.tar.gz * && rm *) || :
|
||||
@[[ $(RELEASE_TARGETS) == *"linux/arm32"* ]] && (echo "Building Linux ARM binary" && GOOS=linux GOARCH=arm $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && tar zcvf ../linux_arm.tar.gz * && rm *) || :
|
||||
@[[ $(RELEASE_TARGETS) == *"windows/amd64"* ]] && (echo "Building Windows AMD64 binary" && GOOS=windows GOARCH=amd64 $(GO) build -ldflags "$(shell bash $(DEVGO_SCRIPTS)/version-ldflags.sh && echo $(BUILD_LDFLAGS))" -o $(BUILD_DIR)/ $(BUILD_PKG) && cd $(BUILD_DIR) && zip -9 -j ../windows_amd64.zip * && rm *) || :
|
||||
|
||||
.PHONY: release-assets
|
Loading…
x
Reference in New Issue
Block a user