Skip to content

Commit

Permalink
Prepare release and initial krew index addition (#25)
Browse files Browse the repository at this point in the history
* Improve goreleaser config

* Add krew release workflow
  • Loading branch information
timebertt authored May 27, 2024
1 parent 901377f commit 7cb80c7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ jobs:
with:
name: release
path: dist/*
- uses: rajatjindal/krew-release-bot@v0.0.46
# Skip release bot step on initial plugin release in favor of manual addition.
# TODO(timebertt): drop the condition after releasing v0.1.0
if: ${{ !startsWith(github.ref, 'refs/tags/v') && github.ref != 'refs/tags/v0.1.0' }}
12 changes: 3 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ builds:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- windows
goarch:
- amd64
- arm64
Expand All @@ -23,13 +23,7 @@ builds:
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ title.Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
# use zip for windows archives
format_overrides:
- goos: windows
Expand All @@ -39,4 +33,4 @@ changelog:
use: github

snapshot:
name_template: "v{{ incpatch .Version }}-dev"
name_template: "v{{ incminor .Version }}-dev-{{ .ShortCommit }}"
41 changes: 41 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: history
spec:
version: {{ .TagName }}
homepage: https://github.com/timebertt/kubectl-history
shortDescription: Time-travel through your cluster
description: |
Go back in time in the history of rollouts and answers common questions like "Why was my Deployment rolled?"
platforms:
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/timebertt/kubectl-history/releases/download/{{ .TagName }}/kubectl-history_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
bin: kubectl-history
- selector:
matchLabels:
os: linux
arch: arm64
{{addURIAndSha "https://github.com/timebertt/kubectl-history/releases/download/{{ .TagName }}/kubectl-history_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
bin: kubectl-history
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/timebertt/kubectl-history/releases/download/{{ .TagName }}/kubectl-history_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
bin: kubectl-history
- selector:
matchLabels:
os: darwin
arch: arm64
{{addURIAndSha "https://github.com/timebertt/kubectl-history/releases/download/{{ .TagName }}/kubectl-history_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
bin: kubectl-history
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/timebertt/kubectl-history/releases/download/{{ .TagName }}/kubectl-history_{{ .TagName }}_windows_amd64.zip" .TagName }}
bin: kubectl-history.exe

0 comments on commit 7cb80c7

Please sign in to comment.