Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: on new release
on:
release:
types: [published]

jobs:
update-krew:
name: update krew
runs-on: ubuntu-latest
steps:
- name: Call krew-release-bot
uses: rajatjindal/krew-release-bot@v0.0.47
13 changes: 3 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

jobs:
push-image:
name: push image
name: push image and prepare release
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -45,20 +45,15 @@ jobs:
run: MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} CLEAN_BUILD=1 make images
- name: build plugin artifact
run: IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} make release
- name: conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: create github release
uses: actions/create-release@v1
id: create_release
with:
draft: false
draft: true
prerelease: false
release_name: ${{ env.tag }}
tag_name: ${{ env.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
body: Edit to remove this content, click on 'generate release notes' above and publish. It will trigger the krew-release-bot.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: push plugin artifact
Expand All @@ -70,5 +65,3 @@ jobs:
asset_path: netobserv-cli.tar.gz
asset_name: netobserv-cli.tar.gz
asset_content_type: application/gzip
- name: Update new version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.47
2 changes: 1 addition & 1 deletion .krew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ spec:
to: "netobserv"
- from: "LICENSE"
to: "."
bin: netobserv
bin: netobserv
41 changes: 4 additions & 37 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is the process of releasing the NetObserv CLI on GitHub. First, tag from th
```bash
git fetch upstream
git reset --hard upstream/(release branch)
version="v0.0.6"
version="v0.0.9"
git tag -a "$version" -m "$version"
git push upstream --tags
```
Expand All @@ -16,47 +16,14 @@ When the tag is pushed, a release action is triggered on GitHub: https://github.

When the job completes, you should see a new draft release in https://github.com/netobserv/network-observability-cli/releases.

### Krew

If you haven't already, fork and clone the krew-index repo from https://github.com/kubernetes-sigs/krew-index.

From there, you'll find the NetObserv plugin info in `plugins/netobserv.yaml`.

Copy and paste the YAML snippet provided in draft release on GitHub, into that `netobserv.yaml` file.

To test it, first download the tgz archive from the GitHub release (see the `netobserv-cli.tar.gz` link under "Assets").

Then:

```bash
# uninstall any previous version of the plugin
kubectl krew uninstall netobserv
# reinstall using the current manifest and archive
kubectl krew install --manifest=plugins/netobserv.yaml --archive=/path/to/netobserv-cli.tar.gz
kubectl netobserv version
# output: Netobserv CLI version <the new version>

# smoke-test on a live cluster
kubectl netobserv flows
```

NB: The process to publish a plugin update is also documented in https://krew.sigs.k8s.io/docs/developer-guide/release/updating-plugins/.

### Publish the GitHub release

When tests are OK, edit the draft release in GitHub:
Edit the draft release in GitHub:
- Remove the text template
- Auto-generate the release note
- Check the "Set as the latest release" box
- Click Publish

### Krew again

Finally, commit the YAML changes and open a pull request:

```bash
git commit -a -s -m "Bump netobserv $version"
git push origin HEAD:bump-$version
```
### Krew

Note: the first time, you may need to sign the CLA for the Linux Foundation / CNCF. Check your PR for any additional step to take.
The krew-release-bot is triggered automatically when the release is published.