From 8a4d1f5169cc8798c92289b44965f8ed59935231 Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Fri, 15 Nov 2019 10:52:12 +0900 Subject: [PATCH] Add LICENSE to distribution (#189) --- .circleci/config.yml | 1 + Makefile | 9 ++++++++- oidc-login.yaml | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4880c4af..2afdb6eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,7 @@ jobs: - run: make check - run: bash <(curl -s https://codecov.io/bash) - run: make run + - run: make dist - run: | if [ "$CIRCLE_TAG" ]; then make release diff --git a/Makefile b/Makefile index 9c800113..0a93b157 100644 --- a/Makefile +++ b/Makefile @@ -21,15 +21,22 @@ run: $(TARGET_PLUGIN) -PATH=.:$(PATH) kubectl oidc-login --help dist: - VERSION=$(CIRCLE_TAG) goxzst -d dist/gh/ -o "$(TARGET)" -t "kubelogin.rb oidc-login.yaml" -- -ldflags "$(LDFLAGS)" + # make the zip files for GitHub Releases + VERSION=$(CIRCLE_TAG) goxzst -d dist/gh/ -i "LICENSE" -o "$(TARGET)" -t "kubelogin.rb oidc-login.yaml" -- -ldflags "$(LDFLAGS)" + zipinfo dist/gh/kubelogin_linux_amd64.zip + # make the Homebrew formula mv dist/gh/kubelogin.rb dist/ + # make the yaml for krew-index mkdir -p dist/plugins cp dist/gh/oidc-login.yaml dist/plugins/oidc-login.yaml .PHONY: release release: dist + # publish to the GitHub Releases ghr -u "$(CIRCLE_PROJECT_USERNAME)" -r "$(CIRCLE_PROJECT_REPONAME)" "$(CIRCLE_TAG)" dist/gh/ + # publish to the Homebrew tap repository ghcp commit -u "$(CIRCLE_PROJECT_USERNAME)" -r "homebrew-$(CIRCLE_PROJECT_REPONAME)" -m "$(CIRCLE_TAG)" -C dist/ kubelogin.rb + # fork krew-index and create a branch ghcp fork-commit -u kubernetes-sigs -r krew-index -b "oidc-login-$(CIRCLE_TAG)" -m "Bump oidc-login to $(CIRCLE_TAG)" -C dist/ plugins/oidc-login.yaml .PHONY: clean diff --git a/oidc-login.yaml b/oidc-login.yaml index 6a1abc4a..441e1960 100644 --- a/oidc-login.yaml +++ b/oidc-login.yaml @@ -30,8 +30,10 @@ spec: sha256: "{{ sha256 .linux_amd64_archive }}" bin: kubelogin files: - - from: "kubelogin" - to: "." + - from: kubelogin + to: . + - from: LICENSE + to: . selector: matchLabels: os: linux @@ -40,8 +42,10 @@ spec: sha256: "{{ sha256 .darwin_amd64_archive }}" bin: kubelogin files: - - from: "kubelogin" - to: "." + - from: kubelogin + to: . + - from: LICENSE + to: . selector: matchLabels: os: darwin @@ -50,8 +54,10 @@ spec: sha256: "{{ sha256 .windows_amd64_archive }}" bin: kubelogin.exe files: - - from: "kubelogin.exe" - to: "." + - from: kubelogin.exe + to: . + - from: LICENSE + to: . selector: matchLabels: os: windows