From d66e2e8a206cddcde41c7e36de877dd816d3887f Mon Sep 17 00:00:00 2001 From: kpeez Date: Tue, 23 Jun 2026 14:33:19 -0700 Subject: [PATCH] add script for version bumps across plugins --- README.md | 10 ++++++++++ scripts/bump.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100755 scripts/bump.sh diff --git a/README.md b/README.md index c398e83..a4b8fb9 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,16 @@ Do not copy only the inner `skills/` folder — clone the full repo so the direc OpenCode auto-discovers all `SKILL.md` files under `~/.opencode/skills/`. No changes to `opencode.json` or any config file are needed. Skills become available after restarting OpenCode. +## Release maintenance + +Update the plugin version across Claude and Codex metadata with: + +```sh +./scripts/bump-version.sh patch +``` + +The script also accepts `major`, `minor`, or an explicit version like `1.1.0`. + ## Skills | Skill | Description | diff --git a/scripts/bump.sh b/scripts/bump.sh new file mode 100755 index 0000000..48da39e --- /dev/null +++ b/scripts/bump.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +files=( + "plugins/obsidian/.claude-plugin/plugin.json" + "plugins/obsidian/.codex-plugin/plugin.json" + ".claude-plugin/marketplace.json" +) + +current_version="$(sed -nE 's/^[[:space:]]*"version": "([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' "${files[0]}" | head -n 1)" +IFS=. read -r major minor patch <<< "$current_version" + +case "$1" in + major) new_version="$((major + 1)).0.0" ;; + minor) new_version="$major.$((minor + 1)).0" ;; + patch) new_version="$major.$minor.$((patch + 1))" ;; + [0-9]*.[0-9]*.[0-9]*) new_version="$1" ;; + *) + echo "Usage: $0 " >&2 + exit 1 + ;; +esac + +for file in "${files[@]}"; do + perl -0pi -e "s/\"version\": \"[0-9]+\\.[0-9]+\\.[0-9]+\"/\"version\": \"$new_version\"/" "$file" +done + +echo "Updated version: $current_version -> $new_version"