From 6ac4fdf8dfd164c0b95b30f0b3b9b147dcc0ff09 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Sat, 4 Apr 2020 19:34:17 +0200 Subject: [PATCH] chore(kubectl): use github action to update krew index Fixed #36 Fixed #39 Signed-off-by: Gianluca Arbezzano --- .github/workflows/release.yaml | 17 ++++++------ .goreleaser.yml | 48 +++++++++++++++++----------------- .krew/profefe.yaml | 38 +++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 32 deletions(-) create mode 100644 .krew/profefe.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 860fa39..d188428 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,32 +3,33 @@ name: goreleaser on: push: branches-ignore: - - '**' + - "**" tags: - - 'v*.*.*' + - "v*.*.*" jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v1 - uses: azure/docker-login@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} email: ${{ secrets.DOCKER_USERNAME }} - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v1 with: go-version: 1.13.x - - - name: Run GoReleaser + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1.2.0 with: version: v0.123.0 args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update new version for plugin 'profefe' in krew-index + uses: rajatjindal/krew-release-bot@v0.0.37 + with: + krew_template_file: .krew/profefe.yaml diff --git a/.goreleaser.yml b/.goreleaser.yml index 5550fc8..5848279 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -5,40 +5,40 @@ before: # you may remove this if you don't use vgo - go mod download builds: -- id: "kubectl-profefe" - main: ./cmd/kubectl-profefe - binary: kubectl-profefe - env: - - CGO_ENABLED=0 -- id: "kprofefe" - main: ./cmd/kprofefe - binary: kprofefe - env: - - CGO_ENABLED=0 + - id: "kubectl-profefe" + main: ./cmd/kubectl-profefe + binary: kubectl-profefe + env: + - CGO_ENABLED=0 + - id: "kprofefe" + main: ./cmd/kprofefe + binary: kprofefe + env: + - CGO_ENABLED=0 archives: -- replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}" checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" snapshot: name_template: "{{ .Tag }}-next" changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - "^docs:" + - "^test:" dockers: - - - binaries: - - kprofefe + - binaries: + - kprofefe goos: linux goarch: amd64 image_templates: - - "profefe/kprofefe:latest" - - "profefe/kprofefe:{{ .Tag }}" + - "profefe/kprofefe:latest" + - "profefe/kprofefe:{{ .Tag }}" dockerfile: Dockerfile.gorelease diff --git a/.krew/profefe.yaml b/.krew/profefe.yaml new file mode 100644 index 0000000..7766dd4 --- /dev/null +++ b/.krew/profefe.yaml @@ -0,0 +1,38 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: profefe +spec: + version: { { .TagName } } + homepage: https://github.com/profefe/kube-profefe + shortDescription: Gather and manage pprof profiles from running pods + description: | + This plugin helps to manage pprof profiles via Profefe. It allows to + collect profiles from running pods with Profefe and retrieve or inspect + profiles stored in Profefe. For more information about Profefe, visit + https://profefe.dev + platforms: + - selector: + matchLabels: + os: darwin + arch: amd64 + uri: "https://github.com/profefe/kube-profefe/releases/download/{{ .TagName }}/kube-profefe_{{ .TagName }}_Darwin_x86_64.tar.gz" + sha256: a2dd151fcaf3b7e4341986c6cc2726e0dccc69d634fc96a0ac97f8b03ad930a5 + bin: kubectl-profefe + files: + - from: kubectl-profefe + to: . + - from: LICENSE + to: . + - selector: + matchLabels: + os: linux + arch: amd64 + uri: "https://github.com/profefe/kube-profefe/releases/download/{{ .TagName }}/kube-profefe_{{ .TagName }}_Linux_x86_64.tar.gz" + sha256: b68479389df557dd29abd42268fdd9fc22b522a1dfe97458bfb5f804da1f6445 + bin: kubectl-profefe + files: + - from: kubectl-profefe + to: . + - from: LICENSE + to: .