Skip to content

Commit ce9f065

Browse files
authored
Semi-automated release (#223)
1 parent 2f27a55 commit ce9f065

File tree

4 files changed

+20
-48
lines changed

4 files changed

+20
-48
lines changed

.github/workflows/on-release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: on new release
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
update-krew:
8+
name: update krew
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Call krew-release-bot
12+
uses: rajatjindal/[email protected]

.github/workflows/release.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
push-image:
13-
name: push image
13+
name: push image and prepare release
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
@@ -45,20 +45,15 @@ 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 }}
5348
- name: create github release
5449
uses: actions/create-release@v1
5550
id: create_release
5651
with:
57-
draft: false
52+
draft: true
5853
prerelease: false
5954
release_name: ${{ env.tag }}
6055
tag_name: ${{ env.tag }}
61-
body: ${{ steps.changelog.outputs.clean_changelog }}
56+
body: Edit to remove this content, click on 'generate release notes' above and publish. It will trigger the krew-release-bot.
6257
env:
6358
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6459
- name: push plugin artifact
@@ -70,5 +65,3 @@ jobs:
7065
asset_path: netobserv-cli.tar.gz
7166
asset_name: netobserv-cli.tar.gz
7267
asset_content_type: application/gzip
73-
- name: Update new version in krew-index
74-
uses: rajatjindal/[email protected]

.krew.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ spec:
2424
to: "netobserv"
2525
- from: "LICENSE"
2626
to: "."
27-
bin: netobserv
27+
bin: netobserv

docs/RELEASE.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is the process of releasing the NetObserv CLI on GitHub. First, tag from th
77
```bash
88
git fetch upstream
99
git reset --hard upstream/(release branch)
10-
version="v0.0.6"
10+
version="v0.0.9"
1111
git tag -a "$version" -m "$version"
1212
git push upstream --tags
1313
```
@@ -16,47 +16,14 @@ When the tag is pushed, a release action is triggered on GitHub: https://github.
1616

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

19-
### Krew
20-
21-
If you haven't already, fork and clone the krew-index repo from https://github.com/kubernetes-sigs/krew-index.
22-
23-
From there, you'll find the NetObserv plugin info in `plugins/netobserv.yaml`.
24-
25-
Copy and paste the YAML snippet provided in draft release on GitHub, into that `netobserv.yaml` file.
26-
27-
To test it, first download the tgz archive from the GitHub release (see the `netobserv-cli.tar.gz` link under "Assets").
28-
29-
Then:
30-
31-
```bash
32-
# uninstall any previous version of the plugin
33-
kubectl krew uninstall netobserv
34-
# reinstall using the current manifest and archive
35-
kubectl krew install --manifest=plugins/netobserv.yaml --archive=/path/to/netobserv-cli.tar.gz
36-
kubectl netobserv version
37-
# output: Netobserv CLI version <the new version>
38-
39-
# smoke-test on a live cluster
40-
kubectl netobserv flows
41-
```
42-
43-
NB: The process to publish a plugin update is also documented in https://krew.sigs.k8s.io/docs/developer-guide/release/updating-plugins/.
44-
4519
### Publish the GitHub release
4620

47-
When tests are OK, edit the draft release in GitHub:
21+
Edit the draft release in GitHub:
4822
- Remove the text template
4923
- Auto-generate the release note
5024
- Check the "Set as the latest release" box
5125
- Click Publish
5226

53-
### Krew again
54-
55-
Finally, commit the YAML changes and open a pull request:
56-
57-
```bash
58-
git commit -a -s -m "Bump netobserv $version"
59-
git push origin HEAD:bump-$version
60-
```
27+
### Krew
6128

62-
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.
29+
The krew-release-bot is triggered automatically when the release is published.

0 commit comments

Comments
 (0)