Skip to content

Commit

Permalink
Send subctl version updates to krew-index
Browse files Browse the repository at this point in the history
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: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
  • Loading branch information
Jaanki authored and sridhargaddam committed Dec 4, 2023
1 parent 768d7ec commit 58636ae
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
91 changes: 91 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ rules:

ignore: |
/projects
.krew.yaml

0 comments on commit 58636ae

Please sign in to comment.