-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·47 lines (38 loc) · 1.29 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -euo pipefail
# Extract version from plugin.json (primary source of truth)
VERSION=$(grep '"version"' .claude-plugin/plugin.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')
if [[ -z "$VERSION" ]]; then
echo "Error: Could not extract version from .claude-plugin/plugin.json"
exit 1
fi
echo "Releasing version $VERSION"
# Verify version matches in SKILL.md
SKILL_VERSION=$(grep -A2 '^metadata:' skills/fecfile/SKILL.md | grep 'version:' | sed 's/.*version: *"\([^"]*\)".*/\1/')
if [[ "$VERSION" != "$SKILL_VERSION" ]]; then
echo "Error: Version mismatch!"
echo " plugin.json: $VERSION"
echo " SKILL.md: $SKILL_VERSION"
echo "Update both files to match before releasing."
exit 1
fi
# Check for uncommitted changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Error: Uncommitted changes. Commit first."
exit 1
fi
# Create version tag
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag $VERSION already exists"
else
git tag -a "$VERSION" -m "Release $VERSION"
echo "Created tag $VERSION"
fi
# Move latest tag
git tag -d latest 2>/dev/null || true
git tag -a latest -m "Latest stable release"
echo "Updated latest tag"
# Push tags
git push origin "$VERSION"
git push origin latest --force
echo "Released $VERSION"