Skip to content

Commit 2f27a55

Browse files
authored
automate krew releases (#195)
1 parent 2c4d165 commit 2f27a55

File tree

4 files changed

+38
-58
lines changed

4 files changed

+38
-58
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,20 @@ jobs:
4545
run: MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} CLEAN_BUILD=1 make images
4646
- name: build plugin artifact
4747
run: IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} make release
48+
- name: conventional Changelog Action
49+
id: changelog
50+
uses: TriPSs/conventional-changelog-action@v6
51+
with:
52+
github-token: ${{ secrets.GITHUB_TOKEN }}
4853
- name: create github release
4954
uses: actions/create-release@v1
5055
id: create_release
5156
with:
52-
draft: true
57+
draft: false
5358
prerelease: false
5459
release_name: ${{ env.tag }}
5560
tag_name: ${{ env.tag }}
56-
body_path: ./tmp/release.md
61+
body: ${{ steps.changelog.outputs.clean_changelog }}
5762
env:
5863
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5964
- name: push plugin artifact
@@ -64,4 +69,6 @@ jobs:
6469
upload_url: ${{ steps.create_release.outputs.upload_url }}
6570
asset_path: netobserv-cli.tar.gz
6671
asset_name: netobserv-cli.tar.gz
67-
asset_content_type: application/gzip
72+
asset_content_type: application/gzip
73+
- name: Update new version in krew-index
74+
uses: rajatjindal/[email protected]

.krew.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: krew.googlecontainertools.github.com/v1alpha2
2+
kind: Plugin
3+
metadata:
4+
name: netobserv
5+
spec:
6+
version: "{{ .TagName }}"
7+
homepage: https://github.com/netobserv/network-observability-cli
8+
shortDescription: "Lightweight Flow and Packet visualization tool"
9+
description: |
10+
Deploys NetObserv eBPF agent on your k8s cluster to collect flows
11+
or packets from nodes network interfaces and streams data to a local
12+
collector for analysis and visualization.
13+
platforms:
14+
- selector:
15+
matchExpressions:
16+
- key: "os"
17+
operator: "In"
18+
values:
19+
- darwin
20+
- linux
21+
{{addURIAndSha ""https://github.com/netobserv/network-observability-cli/releases/download/{{ .TagName }}/netobserv-cli.tar.gz"" .TagName }}
22+
files:
23+
- from: "build/netobserv"
24+
to: "netobserv"
25+
- from: "LICENSE"
26+
to: "."
27+
bin: netobserv

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,9 @@ update-config: ## Update config from operator repo
178178
./scripts/update-config.sh
179179

180180
.PHONY: release
181-
release: clean ## Generate tar.gz containing krew plugin and display krew updated index
181+
release: clean ## Generate tar.gz containing krew plugin
182182
$(MAKE) KREW_PLUGIN=true kubectl-commands
183183
tar -czf netobserv-cli.tar.gz LICENSE ./build/netobserv
184-
@echo "### Generating krew index yaml"
185-
IMAGE_ORG=${IMAGE_ORG} \
186-
VERSION=$(VERSION) \
187-
./scripts/krew.sh
188184

189185
.PHONY: create-kind-cluster
190186
create-kind-cluster: prereqs ## Create a kind cluster

scripts/krew.sh

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)