diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index b96c27fe..e52b5764 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "basecamp", - "version": "0.1.0", + "version": "dev", "description": "Basecamp integration for Claude Code. Create todos, track work, link code to projects.", "author": { "name": "37signals", diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e3459d5c..ccbd08ec 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,6 +6,7 @@ project_name: basecamp before: hooks: - sh -c 'mkdir -p completions && go run ./cmd/basecamp completion bash > completions/basecamp.bash && go run ./cmd/basecamp completion zsh > completions/_basecamp && go run ./cmd/basecamp completion fish > completions/basecamp.fish' + - scripts/stamp-plugin-version.sh {{ .Version }} builds: - id: basecamp diff --git a/scripts/stamp-plugin-version.sh b/scripts/stamp-plugin-version.sh new file mode 100755 index 00000000..73b59c6d --- /dev/null +++ b/scripts/stamp-plugin-version.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +if ! command -v jq >/dev/null 2>&1; then + echo "Error: jq is required but not found. Install with your package manager." >&2 + exit 1 +fi + +# Stamps the CLI release version into .claude-plugin/plugin.json so that +# Claude Code can detect updates. Called by GoReleaser before the build. + +VERSION="${1:?Usage: stamp-plugin-version.sh VERSION}" +PLUGIN_JSON=".claude-plugin/plugin.json" + +jq --arg v "$VERSION" '.version = $v' "$PLUGIN_JSON" > "${PLUGIN_JSON}.tmp" +mv "${PLUGIN_JSON}.tmp" "$PLUGIN_JSON"