Skip to content

Commit 400f1fd

Browse files
committed
chore: add release script for version management
1 parent 639d420 commit 400f1fd

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

scripts/release.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if [ $# -ne 1 ]; then
5+
echo "Usage: ./scripts/release.sh <version>"
6+
echo "Example: ./scripts/release.sh 0.2.0"
7+
exit 1
8+
fi
9+
10+
VERSION="$1"
11+
TAG="v${VERSION}"
12+
13+
if git rev-parse "$TAG" >/dev/null 2>&1; then
14+
echo "Error: tag $TAG already exists"
15+
exit 1
16+
fi
17+
18+
if [ -n "$(git status --porcelain)" ]; then
19+
echo "Error: working directory is not clean"
20+
exit 1
21+
fi
22+
23+
echo "Releasing $TAG..."
24+
25+
sed -i '' "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" .claude-plugin/plugin.json
26+
sed -i '' "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" .claude-plugin/marketplace.json
27+
sed -i '' "s/VERSION=\"[^\"]*\"/VERSION=\"${VERSION}\"/" scripts/on-event.sh
28+
29+
echo "Updated versions:"
30+
grep '"version"' .claude-plugin/plugin.json .claude-plugin/marketplace.json
31+
grep 'VERSION=' scripts/on-event.sh
32+
33+
git add .claude-plugin/plugin.json .claude-plugin/marketplace.json scripts/on-event.sh
34+
git commit -m "release: ${TAG}"
35+
git tag "$TAG"
36+
git push
37+
git push --tags
38+
39+
echo "Done. GoReleaser will build and publish binaries."

0 commit comments

Comments
 (0)