Skip to content

Commit d2191d0

Browse files
authored
fix: sync plugin.json version with latest tag (anomalyco#171)
Sync plugin.json version to 1.4.1, add CI check to verify versions match on release, and add release.sh script. Fixes anomalyco#170.
1 parent 11ad2a8 commit d2191d0

4 files changed

Lines changed: 80 additions & 2 deletions

File tree

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "everything-claude-code",
3-
"version": "1.2.0",
3+
"version": "1.4.1",
44
"description": "Complete collection of battle-tested Claude Code configs from an Anthropic hackathon winner - agents, skills, hooks, and rules evolved over 10+ months of intensive daily use",
55
"author": {
66
"name": "Affaan Mustafa",

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ jobs:
2525
exit 1
2626
fi
2727
28+
- name: Verify plugin.json version matches tag
29+
env:
30+
TAG_NAME: ${{ github.ref_name }}
31+
run: |
32+
TAG_VERSION="${TAG_NAME#v}"
33+
PLUGIN_VERSION=$(grep -oE '"version": *"[^"]*"' .claude-plugin/plugin.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
34+
if [ "$TAG_VERSION" != "$PLUGIN_VERSION" ]; then
35+
echo "::error::Tag version ($TAG_VERSION) does not match plugin.json version ($PLUGIN_VERSION)"
36+
echo "Run: ./scripts/release.sh $TAG_VERSION"
37+
exit 1
38+
fi
39+
2840
- name: Generate changelog
2941
id: changelog
3042
run: |

‎scripts/lib/session-aliases.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
getClaudeDir,
1111
ensureDir,
1212
readFile,
13-
writeFile,
1413
log
1514
} = require('./utils');
1615

‎scripts/release.sh‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Release script for bumping plugin version
5+
# Usage: ./scripts/release.sh VERSION
6+
7+
VERSION="${1:-}"
8+
PLUGIN_JSON=".claude-plugin/plugin.json"
9+
10+
# Function to show usage
11+
usage() {
12+
echo "Usage: $0 VERSION"
13+
echo "Example: $0 1.5.0"
14+
exit 1
15+
}
16+
17+
# Validate VERSION is provided
18+
if [[ -z "$VERSION" ]]; then
19+
echo "Error: VERSION argument is required"
20+
usage
21+
fi
22+
23+
# Validate VERSION is semver format (X.Y.Z)
24+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25+
echo "Error: VERSION must be in semver format (e.g., 1.5.0)"
26+
exit 1
27+
fi
28+
29+
# Check current branch is main
30+
CURRENT_BRANCH=$(git branch --show-current)
31+
if [[ "$CURRENT_BRANCH" != "main" ]]; then
32+
echo "Error: Must be on main branch (currently on $CURRENT_BRANCH)"
33+
exit 1
34+
fi
35+
36+
# Check working tree is clean
37+
if ! git diff --quiet || ! git diff --cached --quiet; then
38+
echo "Error: Working tree is not clean. Commit or stash changes first."
39+
exit 1
40+
fi
41+
42+
# Verify plugin.json exists
43+
if [[ ! -f "$PLUGIN_JSON" ]]; then
44+
echo "Error: $PLUGIN_JSON not found"
45+
exit 1
46+
fi
47+
48+
# Read current version
49+
OLD_VERSION=$(grep -oE '"version": *"[^"]*"' "$PLUGIN_JSON" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
50+
echo "Bumping version: $OLD_VERSION -> $VERSION"
51+
52+
# Update version in plugin.json (cross-platform sed)
53+
if [[ "$OSTYPE" == "darwin"* ]]; then
54+
# macOS
55+
sed -i '' "s/\"version\": *\"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN_JSON"
56+
else
57+
# Linux
58+
sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN_JSON"
59+
fi
60+
61+
# Stage, commit, tag, and push
62+
git add "$PLUGIN_JSON"
63+
git commit -m "chore: bump plugin version to $VERSION"
64+
git tag "v$VERSION"
65+
git push origin main "v$VERSION"
66+
67+
echo "Released v$VERSION"

0 commit comments

Comments
 (0)