From 4ca11f13ac4345a0b239d76a93e6ee475d7f2cc7 Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Sat, 17 Apr 2021 14:50:58 +0900 Subject: [PATCH] Add .exe extension to Windows distribution (#534) --- .github/workflows/go.yaml | 2 ++ .krew.yaml | 2 +- Makefile | 12 +++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 8cf15144..36fd4ec9 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -8,6 +8,7 @@ on: - .github/workflows/go.yaml - pkg/** - go.* + - Makefile tags: - v* pull_request: @@ -17,6 +18,7 @@ on: - .github/workflows/go.yaml - pkg/** - go.* + - Makefile jobs: lint: diff --git a/.krew.yaml b/.krew.yaml index 26f5ef00..8949b52e 100644 --- a/.krew.yaml +++ b/.krew.yaml @@ -54,7 +54,7 @@ spec: matchLabels: os: darwin arch: arm64 - - bin: kubelogin + - bin: kubelogin.exe {{ addURIAndSha "https://github.com/int128/kubelogin/releases/download/{{ .TagName }}/kubelogin_windows_amd64.zip" .TagName }} selector: matchLabels: diff --git a/Makefile b/Makefile index 0fcfc0a9..847c22e4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ -TARGET := kubelogin -TARGET_ARCHIVE := $(TARGET)_$(GOOS)_$(GOARCH).zip -TARGET_DIGEST := $(TARGET)_$(GOOS)_$(GOARCH).zip.sha256 +PRODUCT := kubelogin +TARGET_ARCHIVE := $(PRODUCT)_$(GOOS)_$(GOARCH).zip +TARGET_DIGEST := $(PRODUCT)_$(GOOS)_$(GOARCH).zip.sha256 + +ifeq ($(GOOS), windows) + TARGET := $(PRODUCT).exe +else + TARGET := $(PRODUCT) +endif # determine the version from ref ifeq ($(GITHUB_REF), refs/heads/master)