Skip to content

Commit 1f82e0d

Browse files
committed
feat(release): add release skill for patch and minor releases
Add a new repo-local skill that guides the full CLI release workflow for both minor releases (vX.Y.0) and patch releases (vX.Y.Z). The skill covers 12 steps: prerequisite validation, running release.sh, post-release packaging (RPM, DEB, Homebrew), plumbing repo updates. Includes a prerequisites reference doc and updates AGENTS.md to list the new skill. Signed-off-by: Shiv Verma <shverma@redhat.com> Assisted-by: Claude Opus 4.6 (via Claude Code)
1 parent 56ccadd commit 1f82e0d

3 files changed

Lines changed: 324 additions & 0 deletions

File tree

.agents/skills/release/SKILL.md

Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
---
2+
name: release
3+
description: This skill should be used when the user asks to "do a release", "cut a release", "create a patch release", "create a minor release", "release v0.X.Y", or wants to perform the Tekton CLI release process. Guides the user through the full release workflow including prerequisites, running release.sh, and post-release steps (rpm, deb, homebrew, plumbing).
4+
version: 0.1.0
5+
---
6+
7+
# Tekton CLI Release
8+
9+
Guide the user through the complete Tekton CLI release process — from prerequisites through post-release packaging and distribution.
10+
11+
## Purpose
12+
13+
Skill that:
14+
15+
- Validates all prerequisites before starting
16+
- Determines whether this is a minor or patch release
17+
- Guides running `tekton/release.sh`
18+
- Walks through all post-release steps in order
19+
- Tracks progress through the checklist
20+
21+
## Workflow
22+
23+
### Step 1: Determine release type and version
24+
25+
Ask the user for the target release version if not already provided. The version must match `vX.Y.Z` (e.g., `v0.46.0`, `v0.43.3`).
26+
27+
Determine the release type:
28+
29+
- **Minor release** (`Z == 0`, e.g., `v0.46.0`): Creates a new `release-vX.Y.x` branch from `main`.
30+
- **Patch release** (`Z > 0`, e.g., `v0.43.3`): Uses the existing `release-vX.Y.x` branch. All fixes must already be merged into the `.x` branch.
31+
32+
Tell the user which type was detected.
33+
34+
### Step 2: Validate prerequisites
35+
36+
Check each prerequisite and report status. Refer to `references/prerequisites.md` for the full list.
37+
38+
**Automated checks** (run these):
39+
40+
```bash
41+
# Required binaries
42+
for bin in kubectl jq tkn git gh; do
43+
command -v "$bin" >/dev/null 2>&1 && echo "$bin" || echo "$bin missing"
44+
done
45+
46+
# Kubernetes cluster access
47+
kubectl version --short 2>/dev/null && echo "✓ cluster accessible" || echo "✗ no cluster access"
48+
49+
# Tekton installed on cluster
50+
kubectl get pipeline 2>/dev/null && echo "✓ Tekton installed" || echo "✗ Tekton not installed"
51+
52+
# GPG key configured
53+
git config user.signingkey && echo "✓ GPG signing key set" || echo "✗ no GPG signing key"
54+
55+
# GOPATH set and project path correct
56+
echo "GOPATH=$GOPATH"
57+
[[ -d "${GOPATH}/src/github.com/tektoncd/cli" ]] && echo "✓ project at GOPATH path" || echo "✗ project not at \${GOPATH}/src/github.com/tektoncd/cli"
58+
59+
# gh authenticated
60+
gh auth status 2>&1
61+
62+
# Clean working directory
63+
git status --porcelain
64+
```
65+
66+
**Manual checks** (remind the user to verify):
67+
68+
- Member of [CLI maintainers team](https://github.com/orgs/tektoncd/teams/cli-maintainers)
69+
- GitHub personal access token with `admin:org, read:packages, repo, write:packages` scopes
70+
- Access to [copr repository](https://copr.fedorainfracloud.org/coprs/chmouel/tektoncd-cli/) (for RPM)
71+
- Member of [launchpad team](https://launchpad.net/~tektoncd) with GPG key uploaded (for DEB)
72+
73+
If any automated check fails, stop and help resolve it before proceeding.
74+
75+
**CRITICAL**: The working directory must be clean (no uncommitted changes). If `git status --porcelain` returns output, tell the user to stash or commit changes first.
76+
77+
### Step 3: Patch release — verify fixes are merged
78+
79+
**Skip this step for minor releases.**
80+
81+
For patch releases, verify the release branch exists and contains the expected fixes:
82+
83+
```bash
84+
RELEASE_BRANCH="release-v${VERSION%.*}.x"
85+
git fetch -a --tags upstream
86+
git ls-remote --exit-code upstream "refs/heads/${RELEASE_BRANCH}"
87+
```
88+
89+
Show recent commits on the release branch so the user can confirm the right fixes are included:
90+
91+
```bash
92+
git log --oneline upstream/${RELEASE_BRANCH} -20
93+
```
94+
95+
Ask: **"Are all the fixes for this patch release merged into `${RELEASE_BRANCH}`? (y/n)"**
96+
97+
Do not proceed until confirmed.
98+
99+
### Step 4: Run the release script
100+
101+
**CRITICAL**: This step requires the user to run the command themselves since `release.sh` is interactive (it may prompt for a GitHub token).
102+
103+
Tell the user to run:
104+
105+
```bash
106+
cd ${GOPATH}/src/github.com/tektoncd/cli
107+
./tekton/release.sh vX.Y.Z
108+
```
109+
110+
Explain what the script does:
111+
112+
1. Fetches tags and determines previous release tag
113+
2. For minor releases: creates `release-vX.Y.x` branch from `main`
114+
3. For patch releases: checks out existing `release-vX.Y.x` branch
115+
4. Generates a changelog from commits between previous tag and HEAD
116+
5. Updates the `VERSION` file, commits, and creates a signed tag
117+
6. Pushes the tag and release branch to `upstream`
118+
7. Installs Tekton catalog tasks on the cluster
119+
8. Applies the release pipeline and triggers it
120+
9. Streams pipeline logs via `tkn`
121+
122+
Tell the user: **"Run the release script and let me know when it completes successfully, or if you hit any errors."**
123+
124+
Wait for the user to report back before continuing.
125+
126+
### Step 5: Mark release as published on GitHub
127+
128+
After the release pipeline completes, the GitHub release will be in pre-release state.
129+
130+
```bash
131+
gh release view vX.Y.Z --json isDraft,isPrerelease,tagName
132+
```
133+
134+
Tell the user to:
135+
136+
1. Go to https://github.com/tektoncd/cli/releases/tag/vX.Y.Z
137+
2. Edit the release
138+
3. Change it from pre-release to released (uncheck "Set as a pre-release")
139+
4. Publish the release
140+
141+
**IMPORTANT**: This must be done before building the RPM package.
142+
143+
Ask the user to confirm the release is published before proceeding.
144+
145+
### Step 6: Generate release notes
146+
147+
Invoke the `release-notes` skill to generate and publish release notes for the tag. Tell the user:
148+
149+
**"Let's generate the release notes. You can run `/release-notes vX.Y.Z` or I can generate them now."**
150+
151+
### Step 7: Build RPM package
152+
153+
Guide the user through building the RPM package per `tekton/rpmbuild/README.md`.
154+
155+
**Prerequisites** (remind user):
156+
157+
- Access to [copr repository](https://copr.fedorainfracloud.org/coprs/chmouel/tektoncd-cli/)
158+
- Copr API config at `~/.config/copr` (get from https://copr.fedorainfracloud.org/api/)
159+
- Change `username` field in copr config to `chmouel`
160+
161+
**Steps**:
162+
163+
```bash
164+
# Create copr secret if not exists
165+
kubectl -n release get secret copr-cli-config || \
166+
kubectl -n release create secret generic copr-cli-config --from-file=copr=${HOME}/.config/copr
167+
168+
# Ensure git-clone task is installed
169+
tkn -n release task list | grep git-clone || tkn -n release hub install task git-clone
170+
171+
# Create and run the RPM build
172+
kubectl -n release apply -f tekton/rpmbuild/rpmbuild.yml
173+
kubectl -n release create -f tekton/rpmbuild/rpmbuild-run.yml
174+
175+
# Watch logs
176+
tkn -n release pipelinerun logs rpmbuild-pipelinerun -f
177+
```
178+
179+
Tell the user this may take time if the copr builder is busy.
180+
181+
### Step 8: Build Debian package
182+
183+
Guide the user through building the DEB package per `tekton/debbuild/README.md`. This can start while the RPM is building.
184+
185+
**Prerequisites** (remind user):
186+
187+
- Member of [launchpad team](https://launchpad.net/~tektoncd)
188+
- GPG key uploaded to launchpad profile
189+
- Set `GPG_KEY` environment variable to GPG key user ID
190+
191+
**Steps**:
192+
193+
```bash
194+
export GPG_KEY=<user-gpg-key-id>
195+
cd tekton/debbuild
196+
./run.sh
197+
```
198+
199+
The build uploads to https://launchpad.net/~tektoncd/+archive/ubuntu/cli/+packages — user can check build logs there.
200+
201+
**Known issue**: If the build fails with `build flag -mod=vendor only valid when using modules`, edit `tekton/debbuild/control/rules` and append `GO111MODULE=on` at the build line. If re-pushing after a failed build, increment the release version in `tekton/debbuild/container/buildpackage.sh`.
202+
203+
### Step 9: Homebrew update
204+
205+
Tell the user:
206+
207+
- Homebrew Core has a GitHub Action that automatically bumps the formula every ~3 hours
208+
- Check that a PR like [this example](https://github.com/Homebrew/homebrew-core/pull/171551) is created and merged
209+
- Alternatively, manually update [homebrew-core](https://github.com/Homebrew/homebrew-core) for `tektoncd-cli` formula
210+
211+
### Step 10: Update plumbing repo (optional)
212+
213+
**This step is optional.** Mention it to the user but do not block on it.
214+
215+
Tell the user they can optionally update the `tkn` version in the [tektoncd/plumbing](https://github.com/tektoncd/plumbing/) repo:
216+
217+
1. **test-runner image**: Update `ARG TKN_VERSION=<NEW_VERSION>` in [test-runner Dockerfile](https://github.com/tektoncd/plumbing/blob/main/tekton/images/test-runner/Dockerfile)
218+
2. **tkn image**: Update `ARG TKN_VERSION=<NEW_VERSION>` in [tkn Dockerfile](https://github.com/tektoncd/plumbing/blob/main/tekton/images/tkn/Dockerfile)
219+
220+
### Step 11: Update Arch Linux
221+
222+
Tell the user to go to https://archlinux.org/packages/extra/x86_64/tekton-cli/flag/ and notify packagers that a new version is available, leaving the release URL and their email address.
223+
224+
### Step 12: Update README version
225+
226+
Remind the user to update version numbers in the main `README.md` via a PR to `main`.
227+
228+
## Progress Tracking
229+
230+
After each step, confirm with the user before moving on. Use a checklist format:
231+
232+
```text
233+
Release vX.Y.Z Progress:
234+
[✓] 1. Release type determined (minor/patch)
235+
[✓] 2. Prerequisites validated
236+
[✓] 3. Fixes verified (patch only)
237+
[✓] 4. release.sh completed
238+
[ ] 5. GitHub release published
239+
[ ] 6. Release notes generated
240+
[ ] 7. RPM package built
241+
[ ] 8. DEB package built
242+
[ ] 9. Homebrew updated
243+
[ ] 10. Plumbing repo updated (optional)
244+
[ ] 11. Arch Linux notified
245+
[ ] 12. README version updated
246+
```
247+
248+
## Error Handling
249+
250+
| Scenario | Action |
251+
| --- | --- |
252+
| Binary missing | Tell user how to install it |
253+
| No cluster access | Tell user to configure kubeconfig |
254+
| Tekton not installed | Link to Tekton Pipelines install docs |
255+
| No GPG key | Link to GitHub GPG setup guide |
256+
| Dirty working directory | Tell user to stash or commit |
257+
| Release branch missing (patch) | Error — fixes need to be merged first |
258+
| release.sh fails | Help debug based on error output |
259+
| RPM build fails | Check copr builder status and logs |
260+
| DEB build fails | Check launchpad build logs, suggest GO111MODULE fix |
261+
| GitHub release not found | Script may not have pushed; check tags |
262+
263+
## User Confirmation Requirements
264+
265+
**CRITICAL**: Never run `release.sh` directly — it is interactive and must be run by the user. Always confirm after each major step before proceeding. Never push tags or branches without the user having explicitly run the release script.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Release Prerequisites Reference
2+
3+
## Required Tools
4+
5+
| Tool | Purpose | Install |
6+
| --- | --- | --- |
7+
| `kubectl` | Kubernetes cluster access | https://kubernetes.io/docs/tasks/tools/ |
8+
| `jq` | JSON processing in release script | `brew install jq` / `dnf install jq` |
9+
| `tkn` | Tekton CLI (for pipeline management) | https://tekton.dev/docs/cli/ |
10+
| `git` | Version control, tagging, branching | System package manager |
11+
| `gh` | GitHub CLI (for release notes, auth) | https://cli.github.com/ |
12+
13+
## Access Requirements
14+
15+
| Requirement | How to get it |
16+
| --- | --- |
17+
| CLI maintainers team | Request access via [tektoncd/cli OWNERS](https://github.com/tektoncd/cli/blob/main/OWNERS) |
18+
| GitHub PAT (`admin:org, read:packages, repo, write:packages`) | https://github.com/settings/tokens |
19+
| GPG signing key in git | https://help.github.com/en/github/authenticating-to-github/managing-commit-signature-verification |
20+
| Kubernetes cluster with Tekton | minikube, GKE, or any cluster with `kubectl get pipeline` working |
21+
| Copr admin access (RPM) | Request at https://copr.fedorainfracloud.org/coprs/chmouel/tektoncd-cli/permissions/ |
22+
| Launchpad team (DEB) | Join at https://launchpad.net/~tektoncd/+join and upload GPG key to profile |
23+
24+
## Environment
25+
26+
| Variable | Required | Purpose |
27+
| --- | --- | --- |
28+
| `GOPATH` | Yes | release.sh uses `${GOPATH}/src/github.com/tektoncd/cli` |
29+
| `PUSH_REMOTE` | No | Override push remote for testing (default: `upstream`) |
30+
| `GPG_KEY` | For DEB builds | GPG key user ID for signing Debian packages |
31+
32+
## Release Branch Convention
33+
34+
Release branches follow `release-vX.Y.x`:
35+
36+
- `release-v0.46.x` for the v0.46 release line
37+
- `release-v0.43.x` for the v0.43 release line
38+
39+
### Minor release (e.g., v0.46.0)
40+
41+
- Script creates `release-vX.Y.x` from `main`
42+
- No prior branch expected
43+
44+
### Patch release (e.g., v0.43.3)
45+
46+
- Branch `release-vX.Y.x` must already exist
47+
- All fixes must be merged into the `.x` branch before running the release
48+
- Script detects the branch exists and checks it out
49+
50+
## Previous Tag Detection
51+
52+
The release script auto-detects the previous tag for changelog generation:
53+
54+
- **Patch release**: Finds the latest `vX.Y.*` tag within the same minor version (e.g., for `v0.43.3`, finds `v0.43.2`)
55+
- **Minor release**: Finds the latest `vX.Y.Z` tag across all versions (e.g., for `v0.46.0`, finds `v0.45.0`)

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,7 @@ For complex workflows, use these repo-local skills:
145145
- **Release notes**: Gather PRs between tags, categorize, output formatted
146146
markdown, optionally update GitHub release. Trigger: "create release note",
147147
"generate release notes", "release changelog"
148+
- **Release**: Full CLI release workflow for minor and patch releases. Validates
149+
prerequisites, guides running release.sh, and walks through post-release
150+
steps (RPM, DEB, Homebrew, plumbing). Trigger: "do a release",
151+
"cut a release", "create a patch release", "release vX.Y.Z"

0 commit comments

Comments
 (0)