|
| 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. |
0 commit comments