Repository navigation
fix: sync plugin.json version with latest tag #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
affaan-m
merged 3 commits into
affaan-m:main
from
ericcai0814:fix/plugin-json-version-sync
Feb 9, 2026
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Release script for bumping plugin version | ||
| # Usage: ./scripts/release.sh VERSION | ||
|
|
||
| VERSION="${1:-}" | ||
| PLUGIN_JSON=".claude-plugin/plugin.json" | ||
|
|
||
| # Function to show usage | ||
| usage() { | ||
| echo "Usage: $0 VERSION" | ||
| echo "Example: $0 1.5.0" | ||
| exit 1 | ||
| } | ||
|
|
||
| # Validate VERSION is provided | ||
| if [[ -z "$VERSION" ]]; then | ||
| echo "Error: VERSION argument is required" | ||
| usage | ||
| fi | ||
|
|
||
| # Validate VERSION is semver format (X.Y.Z) | ||
| if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "Error: VERSION must be in semver format (e.g., 1.5.0)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check current branch is main | ||
| CURRENT_BRANCH=$(git branch --show-current) | ||
| if [[ "$CURRENT_BRANCH" != "main" ]]; then | ||
| echo "Error: Must be on main branch (currently on $CURRENT_BRANCH)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check working tree is clean | ||
| if ! git diff --quiet || ! git diff --cached --quiet; then | ||
| echo "Error: Working tree is not clean. Commit or stash changes first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Verify plugin.json exists | ||
| if [[ ! -f "$PLUGIN_JSON" ]]; then | ||
| echo "Error: $PLUGIN_JSON not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Read current version | ||
| OLD_VERSION=$(grep -o '"version": *"[^"]*"' "$PLUGIN_JSON" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+') | ||
| echo "Bumping version: $OLD_VERSION -> $VERSION" | ||
|
|
||
| # Update version in plugin.json (cross-platform sed) | ||
| if [[ "$OSTYPE" == "darwin"* ]]; then | ||
| # macOS | ||
| sed -i '' "s/\"version\": *\"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN_JSON" | ||
| else | ||
| # Linux | ||
| sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN_JSON" | ||
| fi | ||
|
|
||
| # Stage, commit, tag, and push | ||
| git add "$PLUGIN_JSON" | ||
| git commit -m "chore: bump plugin version to $VERSION" | ||
| git tag "v$VERSION" | ||
| git push origin main "v$VERSION" | ||
|
|
||
| echo "Released v$VERSION" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.