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: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 468d5d54a94..ed14289b95a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,4 @@ + builds: - id: "kcp" main: ./cmd/kcp @@ -74,7 +75,28 @@ 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-ws-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - bin/kubectl-ws release: draft: true prerelease: auto mode: keep-existing + +krews: +- name: ws + ids: + - kubectl-kcp-plugin-krew + 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