AgentSkillsCN

github-release

为 TransFlow 发布新的 GitHub Release 版本——包括版本号升级、发布说明撰写、DMG 构建,以及 gh CLI 的使用。当用户提出“发布新版本”“发布正式版”“创建 GitHub Release”,或提到“发布 vX.Y.Z”时,即可启用此技能。

SKILL.md
--- frontmatter
name: github-release
description: Publish a new GitHub Release for TransFlow with version bump, release notes, DMG build, and gh CLI. Use when the user asks to release a version, publish a release, create a GitHub release, or mentions "发布 vX.Y.Z".

GitHub Release

Publish a new TransFlow version to GitHub Releases with DMG attachment.

Prerequisites

  • gh CLI installed and authenticated (gh auth status)
  • create-dmg installed (brew install create-dmg)
  • Xcode Command Line Tools
  • Working directory clean (no uncommitted changes unrelated to release)

Workflow

Parse the target version from the user's request (e.g. "发布 v1.2.0" → 1.2.0). Strip the v prefix for version strings used in code; keep v prefix for git tags.

code
Task Progress:
- [ ] Step 1: Pre-flight checks
- [ ] Step 2: Update version numbers
- [ ] Step 3: Generate release notes
- [ ] Step 4: Commit, tag, push
- [ ] Step 5: Build DMG locally
- [ ] Step 6: Create GitHub Release with DMG
- [ ] Step 7: Verify release

Step 1: Pre-flight checks

Run in parallel:

  • gh auth status — confirm GitHub CLI is authenticated
  • git status — confirm working directory is clean (or only has expected changes)
  • git log --oneline -20 — review recent commits for release notes

Step 2: Update version numbers

Update MARKETING_VERSION in all 6 locations inside project.pbxproj:

bash
# File: TransFlow/TransFlow.xcodeproj/project.pbxproj
# Replace all occurrences:
MARKETING_VERSION = <old>;  →  MARKETING_VERSION = <new>;

Update fallback version strings in Swift source:

FileWhat to change
TransFlow/TransFlow/Models/JSONLModels.swift?? "X.Y.Z" fallback in init
TransFlow/TransFlow/Views/SettingsView.swift?? "X.Y.Z" fallback in appVersionString

Step 3: Generate release notes

Create release-notes/vX.Y.Z.md based on git log since the last tag (or all commits if first release).

Convention: All release notes live in the release-notes/ directory at the repo root, named v<version>.md (e.g. release-notes/v1.0.0.md).

Release notes template:

markdown
# TransFlow vX.Y.Z

[One-line summary of this release]

## What's New
- Feature 1
- Feature 2

## Improvements
- Improvement 1

## Bug Fixes
- Fix 1 (if any)

## System Requirements
- macOS 15.0 or later
- Apple Silicon (arm64) or Intel (x86_64)

If there is a previous tag, use git log <prev-tag>..HEAD --oneline to scope changes.

Step 4: Commit, tag, push

bash
git add -A
git commit -m "release: bump version to vX.Y.Z"
git tag -a vX.Y.Z -m "TransFlow vX.Y.Z"
git push origin main --tags

Step 5: Build DMG locally

bash
./scripts/build-dmg.sh --clean
  • Set block_until_ms to 300000 (5 min) — build + DMG takes time
  • Output: build/TransFlow-X.Y.Z.dmg
  • Verify the DMG file exists and is non-empty before proceeding

Step 6: Create GitHub Release

bash
gh release create vX.Y.Z \
  --title "TransFlow vX.Y.Z" \
  --notes-file release-notes/vX.Y.Z.md \
  ./build/TransFlow-X.Y.Z.dmg

Step 7: Verify release

bash
gh release view vX.Y.Z

Confirm:

  • Title and tag are correct
  • draft: false, prerelease: false
  • DMG asset is listed with non-zero size
  • Release notes render correctly

Report the release URL to the user.

Error Handling

ErrorAction
gh auth failsAsk user to run gh auth login
xcodebuild failsCheck build errors, fix, retry
create-dmg exit code ≠ 0 and ≠ 2Check script output for details
gh release create failsCheck if tag already has a release; use gh release delete vX.Y.Z then retry
DMG file missing after buildCheck build/ directory; re-run build script