用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/qhkm/zeptoclaw-skills --skill git-release命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | git-release |
| version | 1.0.0 |
| description | Automate semver releases — bump version, generate changelog, tag, and publish GitHub Release. |
| author | ZeptoClaw |
| license | MIT |
| tags | ["git","release","devops","changelog","semver"] |
| env_needed | [{"name":"GITHUB_TOKEN","description":"Personal access token with repo scope (for creating GitHub Releases)","required":true},{"name":"GH_REPO","description":"Repository in owner/repo format (e.g. myorg/myapp)","required":true}] |
| metadata | {"zeptoclaw":{"emoji":"🚀","requires":{"anyBins":["git","gh","jq"]}}} |
Automate the full release workflow: semver bump → changelog → git tag → GitHub Release.
export GITHUB_TOKEN="ghp_xxx..."
export GH_REPO="myorg/myapp"
Or if already logged in with gh auth login, skip GITHUB_TOKEN — the gh CLI uses its own token.
# Show last tag
git describe --tags --abbrev=0
# Commits since last tag
git log $(git describe --tags --abbrev=0)..HEAD --oneline
# Count breaking / feat / fix
git log $(git describe --tags --abbrev=0)..HEAD --oneline | grep -c "^.*feat"
git log $(git describe --tags --abbrev=0)..HEAD --oneline | grep -c "^.*fix"
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
MAJOR=$(echo $LAST_TAG | sed 's/v//' | cut -d. -f1)
MINOR=$(echo $LAST_TAG | sed 's/v//' | cut -d. -f2)
PATCH=$(echo $LAST_TAG | sed 's/v//' | cut -d. -f3)
# Bump patch (bug fixes only)
NEXT="v${MAJOR}.${MINOR}.$((PATCH + 1))"
# Bump minor (new features, no breaking changes)
NEXT="v${MAJOR}.$((MINOR + 1)).0"
# Bump major (breaking changes)
NEXT="v).0.0"
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
RANGE="${LAST_TAG:+${LAST_TAG}..}HEAD"
# Categorized changelog
BREAKING=$(git log $RANGE --oneline | grep -i "BREAKING\|!:" || true)
FEATURES=$(git log $RANGE --oneline | grep -i "^[a-f0-9]* feat" || true)
FIXES=$(git log $RANGE --oneline | grep -i "^[a-f0-9]* fix" || true)
OTHERS=$(git log $RANGE --oneline | grep -iv "^[a-f0-9]* \(feat\|fix\|chore\|docs\)" || true)
cat << EOF
## What's Changed
${BREAKING:+### Breaking Changes
$BREAKING
}${FEATURES:+### Features
$FEATURES
}${FIXES:+### Bug Fixes
$FIXES
}${OTHERS:+### Other Changes
$OTHERS
}
**Full Changelog**: https://github.com/$GH_REPO/compare/${LAST_TAG}...${NEXT}
EOF
NEXT="v1.2.0" # set your version
# Create annotated tag
git tag -a "$NEXT" -m "Release $NEXT"
# Push tag
git push origin "$NEXT"
echo "Tag $NEXT pushed"
# Generate notes and create release
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null | head -1)
NOTES=$(git log ${LAST_TAG:+${LAST_TAG}..}HEAD --oneline \
| sed 's/^[a-f0-9]* /- /' \
| head -30)
gh release create "$NEXT" \
--title "Release $NEXT" \
--notes "## What's Changed
$NOTES
**Full Changelog**: https://github.com/$GH_REPO/compare/${LAST_TAG}...${NEXT}" \
--verify-tag
# Build first (adjust for your stack)
# cargo build --release
# npm run build
# Upload artifacts
gh release upload "$NEXT" \
./target/release/myapp \
./target/release/myapp.tar.gz \
--clobber
# Set version
NEXT="v1.2.0"
LAST=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
# Tag
git tag -a "$NEXT" -m "Release $NEXT" && git push origin "$NEXT"
# Release
gh release create "$NEXT" \
--generate-notes \
--title "Release $NEXT"
echo "Released: https://github.com/$GH_REPO/releases/tag/$NEXT"
--generate-notes with gh release create — GitHub auto-generates changelog from PRsCargo.toml version before tagging: sed -i "s/^version = .*/version = \"1.2.0\"/" Cargo.tomlnpm version patch/minor/major auto-bumps package.json and creates a commit + tagv prefix (v1.2.0) — most tools expect it--draft, review, then gh release edit $NEXT --draft=false