From b246c5a2f223954a19c1f2041fb23ee4c152eb3a Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sun, 22 Dec 2024 15:22:29 +0100 Subject: [PATCH] feat(release): include plugin completion in release artifact --- .goreleaser.yml | 4 +-- krew/README.md | 4 +-- krew/ctx.yaml | 68 ++++++++++++++++++++++++++++++++++++----------- krew/ns.yaml | 70 ++++++++++++++++++++++++++++++++++++++----------- 4 files changed, 111 insertions(+), 35 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4522243..fb98655 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -74,7 +74,7 @@ archives: format_overrides: - goos: windows format: zip - files: ["LICENSE"] + files: ["LICENSE", "completion/plugins/kubectl_complete-ctx"] - id: kubens-archive name_template: |- kubens_{{ .Tag }}_{{ .Os }}_ @@ -94,7 +94,7 @@ archives: format_overrides: - goos: windows format: zip - files: ["LICENSE"] + files: ["LICENSE", "completion/plugins/kubectl_complete-ns"] checksum: name_template: "checksums.txt" algorithm: sha256 diff --git a/krew/README.md b/krew/README.md index 35f0a11..221e4dc 100644 --- a/krew/README.md +++ b/krew/README.md @@ -5,7 +5,7 @@ manually install kubectx and kubens from manifest file this add autocomplete plugin capabilities ```shell -$ kubectl krew install --manifest=ns.yaml -$ kubectl krew install --manifest=ctx.yaml +$ kubectl krew install --manifest=krew/ctx.yaml +$ kubectl krew install --manifest=krew/ns.yaml ``` diff --git a/krew/ctx.yaml b/krew/ctx.yaml index da0ef81..5e499c9 100644 --- a/krew/ctx.yaml +++ b/krew/ctx.yaml @@ -16,20 +16,58 @@ spec: See https://github.com/RouxAntoine/kubectx for customization and details. platforms: - selector: - matchExpressions: - - key: os - operator: In - values: - - darwin - - linux - uri: https://github.com/ahmetb/RouxAntoine/archive/v0.9.5-1.tar.gz - sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004 + matchLabels: + os: linux + arch: amd64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_linux_x86_64.tar.gz + sha256: bin: kubectx files: - - from: kubectx-*/kubectx - to: . - - from: kubectx-*/LICENSE - to: . - - from: kubectx-*/completion/plugins/kubectl_complete-ctx - to: completion - + - from: kubectx + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ctx + to: completion + - selector: + matchLabels: + os: linux + arch: arm64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_linux_arm64.tar.gz + sha256: + bin: kubectx + files: + - from: kubectx + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ctx + to: completion + - selector: + matchLabels: + os: darwin + arch: amd64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_darwin_x86_64.tar.gz + sha256: + bin: kubectx + files: + - from: kubectx + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ctx + to: completion + - selector: + matchLabels: + os: darwin + arch: arm64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_darwin_arm64.tar.gz + sha256: + bin: kubectx + files: + - from: kubectx + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ctx + to: completion diff --git a/krew/ns.yaml b/krew/ns.yaml index 0a8d8e4..00e8977 100644 --- a/krew/ns.yaml +++ b/krew/ns.yaml @@ -15,20 +15,58 @@ spec: as you type. platforms: - selector: - matchExpressions: - - key: os - operator: In - values: - - darwin - - linux - uri: https://github.com/RouxAntoine/kubectx/archive/v0.9.5-1.tar.gz - sha256: c94392fba8dfc5c8075161246749ef71c18f45da82759084664eb96027970004 - bin: kubens + matchLabels: + os: linux + arch: amd64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_linux_x86_64.tar.gz + sha256: + bin: kubectx files: - - from: kubectx-*/kubens - to: . - - from: kubectx-*/LICENSE - to: . - - from: kubectx-*/completion/plugins/kubectl_complete-ns - to: completion - + - from: kubens + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ns + to: completion + - selector: + matchLabels: + os: linux + arch: arm64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_linux_arm64.tar.gz + sha256: + bin: kubectx + files: + - from: kubens + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ns + to: completion + - selector: + matchLabels: + os: darwin + arch: amd64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_darwin_x86_64.tar.gz + sha256: + bin: kubectx + files: + - from: kubens + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ns + to: completion + - selector: + matchLabels: + os: darwin + arch: arm64 + uri: https://github.com/RouxAntoine/kubectx/releases/download/v0.9.5-1/kubectx_v0.9.5-1_darwin_arm64.tar.gz + sha256: + bin: kubectx + files: + - from: kubens + to: . + - from: LICENSE + to: . + - from: completion/plugins/kubectl_complete-ns + to: completion