From 8fce8d6eb57bbcdb442596e35ad42793a04b0af2 Mon Sep 17 00:00:00 2001 From: Mangirdas Judeikis Date: Fri, 15 Mar 2024 19:03:48 +0200 Subject: [PATCH 1/5] add krew indx --- .goreleaser.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 468d5d54a94..8ece2bdb6da 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,4 @@ + builds: - id: "kcp" main: ./cmd/kcp @@ -78,3 +79,17 @@ release: draft: true prerelease: auto mode: keep-existing + +krews: +- name: ws + ids: + - kubectl-workspace + repository: + owner: kcp-dev + name: krew-index + token: "{{ .Env.KREW_GITHUB_TOKEN }}" + homepage: "https://kcp.io/" + description: | + KCP workspace cli plugin for kubectl. Enables you to manage your kcp workspaces. + short_description: "KCP workspace cli plugin for kubectl." + skip_upload: auto From d369233b35639eba45a3b6989e6b7cb1b092ce7e Mon Sep 17 00:00:00 2001 From: Mangirdas Judeikis Date: Fri, 15 Mar 2024 19:05:32 +0200 Subject: [PATCH 2/5] add secret --- .github/workflows/goreleaser.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 0656cab1187..eb8866fe004 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -36,6 +36,7 @@ jobs: args: release --timeout 60m env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }} - name: Run GoReleaser on pull request if: github.event_name == 'pull_request' uses: goreleaser/goreleaser-action@v4 @@ -45,6 +46,7 @@ jobs: args: release --timeout 60m --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }} - uses: cytopia/upload-artifact-retry-action@v0.1.7 if: ${{ always() }} with: From cfe9a27cbbe3588645aaa7bba9c805a130125b42 Mon Sep 17 00:00:00 2001 From: Mangirdas Judeikis Date: Fri, 15 Mar 2024 19:46:47 +0200 Subject: [PATCH 3/5] change to archive --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8ece2bdb6da..328323a91bf 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -83,7 +83,7 @@ release: krews: - name: ws ids: - - kubectl-workspace + - kubectl-kcp-plugin repository: owner: kcp-dev name: krew-index From 72a67d93779511607f80df9a27b54a3103facfed Mon Sep 17 00:00:00 2001 From: Mangirdas Judeikis Date: Fri, 15 Mar 2024 20:07:21 +0200 Subject: [PATCH 4/5] move to dedicated archive --- .goreleaser.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 328323a91bf..fe7292d8de2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -75,6 +75,13 @@ archives: files: - bin/kubectl-workspaces - bin/kubectl-ws +# krew has separate archive as it supports only one binary per plugin +- id: kubectl-kcp-plugin-krew + builds: + - kubectl-workspace + name_template: "kubectl-kcp-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - bin/kubectl-ws release: draft: true prerelease: auto @@ -83,7 +90,7 @@ release: krews: - name: ws ids: - - kubectl-kcp-plugin + - kubectl-kcp-plugin-krew repository: owner: kcp-dev name: krew-index From ac24a575ea0173f75f776d4f07b1503c6bb36181 Mon Sep 17 00:00:00 2001 From: Mangirdas Judeikis Date: Fri, 15 Mar 2024 20:25:41 +0200 Subject: [PATCH 5/5] change name template --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fe7292d8de2..ed14289b95a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -79,7 +79,7 @@ archives: - id: kubectl-kcp-plugin-krew builds: - kubectl-workspace - name_template: "kubectl-kcp-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "kubectl-kcp-ws-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}" files: - bin/kubectl-ws release: