From e11b3af1b7c27cadd52496627eae5d6f961c5050 Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Thu, 30 Nov 2023 12:21:42 +0530 Subject: [PATCH] Send subctl version updates to krew-index Now that subctl is available as a krew plugin, a PR needs to be sent to krew-index repo to update subctl version when a new version is released. krew-release-bot automates this process by adding a .krew.yaml file and a GHA to our release process. This PR adds a GHA that automatically pushes a PR to krew-index repo updating the subctl version, by rendering .krew.yaml file, after a new submariner version is tagged. For detailed read: https://github.com/rajatjindal/krew-release-bot Epic: https://github.com/submariner-io/enhancements/issues/182 Signed-off-by: Janki Chhatbar --- .github/workflows/release.yml | 3 ++ .krew.yaml | 91 +++++++++++++++++++++++++++++++++++ .yamllint.yml | 1 + 3 files changed, 95 insertions(+) create mode 100644 .krew.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ff5ff8d..f19ce60d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,3 +37,6 @@ jobs: RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITHUB_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }} run: make do-release + + - name: Update new version in krew-index + uses: rajatjindal/krew-release-bot@v0.0.46 diff --git a/.krew.yaml b/.krew.yaml new file mode 100644 index 00000000..3b15f010 --- /dev/null +++ b/.krew.yaml @@ -0,0 +1,91 @@ +# This template is generated by krew-release-bot-helper +# https://rajatjindal.com/tools/krew-release-bot-helper/ + +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: subm +spec: + version: "{{ .TagName }}" + homepage: https://github.com/submariner-io/subctl + shortDescription: "Manages Submariner and its services" + description: | + CLI to install, uninstall and troubleshoot Submariner on a Kubernetes cluster. + platforms: + - selector: + matchLabels: + os: linux + arch: amd64 + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-linux-amd64.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: linux + arch: arm64 + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-linux-arm64.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: linux + arch: arm + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-linux-arm.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: linux + arch: ppc64le + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-linux-ppc64le.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: windows + arch: amd64 + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-windows-amd64.exe.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: darwin + arch: amd64 + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-darwin-amd64.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl + - selector: + matchLabels: + os: darwin + arch: arm64 + {{addURIAndSha "https://github.com/submariner-io/releases/releases/download/{{ .TagName }}/subctl-{{ .TagName }}-darwin-arm64.tar.gz" .TagName | indent 6 }} + files: + - from: subctl*/subctl + to: . + - from: LICENSE + to: . + bin: subctl diff --git a/.yamllint.yml b/.yamllint.yml index df77cde6..363f9cd5 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -10,3 +10,4 @@ rules: ignore: | /projects + .krew.yaml