Skip to content
Merged
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
107 changes: 107 additions & 0 deletions .claude/skills/cut-release/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: cut-release
description: >-
Cut (publish) a release of meshsync by publishing the current Release Drafter
draft with the gh CLI. Use this whenever the user asks to "cut a release",
"publish the release", "ship a release", "release meshsync", "do a release",
"release the latest merge", or wants the recently merged PR to go out. Handles
waiting for the Release Drafter workflow to fold the just-merged PR into the
draft notes, then flipping the draft to published so the multi-platform Docker
build-and-release workflow fires. The version tag is already set by Release
Drafter and auto-increments after each release, so this skill never creates or
bumps a tag.
---

# Cut a meshsync release

Publishing a release here is intentionally a one-action step: **flip the existing
Release Drafter draft from draft to published.** Everything downstream is automated
by GitHub Actions.

## How releasing works in this repo

- `.github/workflows/release-drafter.yml` runs on **every push to `master`**. As PRs
merge, it maintains a single **draft** GitHub Release whose tag auto-increments (the
patch version bumps after each publish). There is always exactly one draft waiting to
be published.
Comment on lines +23 to +26
Comment on lines +23 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Avoid asserting that a draft always exists.

This conflicts with the later documented zero-draft case at Lines 106-107 and can make users assume a release is available when none exists. Use “normally maintains one draft” and retain the explicit count check before publishing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/cut-release/SKILL.md around lines 23 - 26, Update the
release-drafter description in the cut-release skill to say it normally
maintains one draft rather than asserting that exactly one draft always exists.
Preserve the later explicit draft-count check and its documented zero-draft
behavior.

- Publishing that draft (the release `published` event) triggers
`.github/workflows/multi-platform.yml`, which builds the multi-architecture meshsync
container images and pushes them to the registry, tagged with the released version.
Comment on lines +27 to +29

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Capitalize “GitHub.”

Change “GitHub Actions” to use the platform’s official capitalization.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: The official name of this software platform is spelled with a capital “H”.
Context: ...the release published event) triggers .github/workflows/multi-platform.yml, which bu...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/cut-release/SKILL.md around lines 27 - 29, Update the release
workflow documentation in SKILL.md to capitalize “GitHub” correctly wherever the
platform name appears, including the “GitHub Actions” reference, without
changing the surrounding release behavior description.

Source: Linters/SAST tools


So the tag is already chosen and the notes are already drafted. Your job is only to make
sure the just-merged PR is reflected in the draft, then publish it. **Do not create a tag,
do not bump a version, do not write release notes by hand** - Release Drafter owns all of that.

## Steps

### 1. Confirm the Release Drafter run for the latest master commit has finished

The draft only includes a PR after the drafter workflow run for that merge commit completes.
If you publish too early, the just-merged PR is missing from the notes.

```bash
# Latest master commit that should be in the release
git fetch origin master --quiet && git rev-parse origin/master

# Most recent Release Drafter runs (headSha should match origin/master, status "completed")
gh run list --workflow="release-drafter.yml" --branch master --limit 3 \
--json databaseId,status,conclusion,headSha,createdAt
```

If the run for the current `origin/master` SHA is still `in_progress` (or absent because the
push just landed), wait for it before publishing:

```bash
gh run watch <databaseId> --exit-status
```
Comment on lines +51 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle an absent workflow run before calling gh run watch.

When the run is absent, there is no <databaseId> to pass to gh run watch. Explicitly instruct the user to rerun or poll gh run list until the run appears, then watch that run.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/cut-release/SKILL.md around lines 51 - 56, Update the release
workflow instructions around the current origin/master SHA to handle an absent
workflow run before invoking gh run watch: instruct the user to rerun or poll gh
run list until the run appears, then pass its database ID to gh run watch;
retain the existing wait behavior for runs already in_progress.


A `conclusion` of `success` for the run whose `headSha` matches `origin/master` means the draft
is up to date. If the latest run **failed**, stop and surface that - do not publish stale notes.

### 2. Identify and inspect the draft

```bash
# Tag of the current draft (there is normally exactly one)
gh release list --limit 25 --json tagName,isDraft --jq '.[] | select(.isDraft) | .tagName'

# Read the draft notes and confirm the recently merged PR appears in them
gh release view <draftTag> --json tagName,name,isDraft,body --jq \
'{tag: .tagName, name: .name, isDraft: .isDraft, body: .body}'
```

Verify the merged PR the user is releasing shows up under one of the category headings. If it
does not, the drafter run from step 1 has not yet indexed it - re-check step 1 rather than
publishing without it.

If more than one draft is ever returned, stop and ask the user which to publish rather than
guessing - publishing the wrong one ships an unintended version.

### 3. Publish the draft

Flipping `--draft=false` publishes it and fires the `published` event that drives the
multi-platform image build and push. Mark it `--latest` so it carries the "Latest" badge.

```bash
gh release edit <draftTag> --draft=false --latest
```

### 4. Confirm it published

```bash
gh release view <draftTag> --json tagName,isDraft,isLatest,publishedAt --jq \
'{tag: .tagName, isDraft: .isDraft, isLatest: .isLatest, publishedAt: .publishedAt}'
```

`isDraft: false` and a non-null `publishedAt` confirm the release is out. Report the published
version to the user and note that the multi-platform Docker build-and-release workflow has been
triggered by the release event.

## What to watch for

- **Don't publish ahead of the drafter run.** The most common failure is publishing before the
Release Drafter workflow has folded the merged PR into the notes, shipping a release whose notes
omit the very change being released. Step 1 exists to prevent exactly this.
- **Never hand-author the tag or notes.** If you find yourself computing a version number or
writing changelog entries, something is wrong - Release Drafter already did both.
- **One draft only.** If `gh release list` shows zero drafts, no drafter run has occurred since the
last release; if it shows more than one, ask the user which to publish.