Create a new release with version bump, changelog, and GitHub release
Automates version bumps, changelog generation, and GitHub releases for Claude Code plugins.
/plugin marketplace add gopherguides/gopher-ai/plugin install productivity@gopher-ai[patch|minor|major]basename \git rev-parse --show-toplevel 2>/dev/null` 2>/dev/null || echo "unknown"`jq -r '.plugins[0].version' .claude-plugin/marketplace.json 2>/dev/null || echo "unknown"git describe --tags --abbrev=0 2>/dev/null || echo "No tags found"TAG=\git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD`; git log "$TAG"..HEAD --oneline 2>/dev/null | wc -l | tr -d ' ' || echo "0"`Create a new release for the gopher-ai plugin marketplace.
If $ARGUMENTS is provided (patch, minor, or major), use that bump type.
If $ARGUMENTS is empty, analyze commits since the last tag to suggest a bump type:
BREAKING CHANGE:, !: suffix)feat:)fix:, chore:, docs:, etc.)Ask the user to confirm the bump type using AskUserQuestion before proceeding.
Validate State
git status --porcelainDetect Changelog Strategy
Automatically detect whether the project uses PR-based or direct-commit workflow:
# Get last tag (or first commit if no tags)
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)
# Count total commits since last tag
TOTAL_COMMITS=$(git log ${LAST_TAG}..HEAD --oneline | wc -l | tr -d ' ')
# Count commits with PR references like (#123)
PR_COMMITS=$(git log ${LAST_TAG}..HEAD --oneline | grep -E '\(#[0-9]+\)' | wc -l | tr -d ' ')
# Calculate percentage (avoid division by zero)
if [ "$TOTAL_COMMITS" -gt 0 ]; then
PR_PERCENTAGE=$((PR_COMMITS * 100 / TOTAL_COMMITS))
else
PR_PERCENTAGE=0
fi
Decision logic:
--generate-notes)Report which strategy was detected to the user.
Calculate New Version
.claude-plugin/marketplace.jsonUpdate Versions
.claude-plugin/marketplace.json:jq --arg v "NEW_VERSION" '
.metadata.version = $v |
.plugins[].version = $v
' .claude-plugin/marketplace.json > /tmp/marketplace.json.tmp && \
mv /tmp/marketplace.json.tmp .claude-plugin/marketplace.json
plugin.json (Claude Code uses these for cache paths):for pjson in plugins/*/.claude-plugin/plugin.json; do
jq --arg v "NEW_VERSION" '.version = $v' "$pjson" > /tmp/pj.tmp && mv /tmp/pj.tmp "$pjson"
done
Commit and Tag
git add .claude-plugin/marketplace.json plugins/*/.claude-plugin/plugin.json
git commit -m "chore: release vX.Y.Z"
git tag -a vX.Y.Z -m "Release vX.Y.Z"
Push to Remote
git push origin main
git push origin vX.Y.Z
Create GitHub Release
Use the strategy detected in step 2:
Use GitHub's auto-generated notes which work well for PR-based repos:
gh release create vX.Y.Z --title "vX.Y.Z" --generate-notes
Generate changelog from commit messages:
git log LAST_TAG..HEAD --format="%s" --reversefeat:) - New functionalityfix:) - Bug fixesrefactor:) - Code changes that neither fix bugs nor add featureschore:, docs:, style:, perf:, test:, ci:) - Everything else--notes flag:gh release create vX.Y.Z --title "vX.Y.Z" --notes "$(cat <<'EOF'
## What's Changed
### Features
- **(scope)** description
### Bug Fixes
- **(scope)** description
**Full Changelog**: https://github.com/OWNER/REPO/compare/vOLD...vNEW
EOF
)"
Formatting rules for conventional commits:
type(scope): description or type: description- **(scope)** description or - description (if no scope)chore: release)Build Universal Distribution
./scripts/build-universal.sh
Upload platform-specific archives as release assets:
gh release upload vX.Y.Z dist/gopher-ai-codex-skills-vX.Y.Z.tar.gz
gh release upload vX.Y.Z dist/gopher-ai-gemini-extensions-vX.Y.Z.tar.gz
Report Success
./scripts/refresh-plugins.sh to update local cache/release - Auto-detect bump type from commits/release patch - Force patch bump (1.1.0 → 1.1.1)/release minor - Force minor bump (1.1.0 → 1.2.0)/release major - Force major bump (1.1.0 → 2.0.0)/releasePrepare a new release by updating changelog, version, and documentation