mirror of
https://github.com/int128/kubelogin.git
synced 2026-02-14 16:39:51 +00:00
CGO_ENABLE as a make option (#299)
* CGO_ENABLE as a make option * Update Makefile * Update Makefile Co-authored-by: Thomas Dmytryk <tdmytryk@tesla.com> Co-authored-by: Hidetake Iwata <int128@gmail.com>
This commit is contained in:
7
Makefile
7
Makefile
@@ -8,6 +8,9 @@ TARGET_OSARCH := linux_amd64 darwin_amd64 windows_amd64 linux_arm linux_arm64
|
||||
VERSION ?= $(CIRCLE_TAG)
|
||||
LDFLAGS := -X main.version=$(VERSION)
|
||||
|
||||
CGO_ENABLED ?= 0
|
||||
export CGO_ENABLED
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(wildcard **/*.go)
|
||||
@@ -16,13 +19,13 @@ $(TARGET): $(wildcard **/*.go)
|
||||
.PHONY: check
|
||||
check:
|
||||
golangci-lint run
|
||||
go test -v -race -cover -coverprofile=coverage.out ./... > gotest.log
|
||||
CGO_ENABLED=1 go test -v -race -cover -coverprofile=coverage.out ./... > gotest.log
|
||||
|
||||
.PHONY: dist
|
||||
dist: dist/output
|
||||
dist/output:
|
||||
# make the zip files for GitHub Releases
|
||||
VERSION=$(VERSION) CGO_ENABLED=0 goxzst -d dist/output -i "LICENSE" -o "$(TARGET)" -osarch "$(TARGET_OSARCH)" -t "dist/kubelogin.rb dist/oidc-login.yaml dist/Dockerfile" -- -ldflags "$(LDFLAGS)"
|
||||
VERSION=$(VERSION) goxzst -d dist/output -i "LICENSE" -o "$(TARGET)" -osarch "$(TARGET_OSARCH)" -t "dist/kubelogin.rb dist/oidc-login.yaml dist/Dockerfile" -- -ldflags "$(LDFLAGS)"
|
||||
# test the zip file
|
||||
zipinfo dist/output/kubelogin_linux_amd64.zip
|
||||
# make the krew yaml structure
|
||||
|
||||
Reference in New Issue
Block a user