diff --git a/.github/workflows/gemini-release.yml b/.github/workflows/gemini-release.yml new file mode 100644 index 0000000..2912f66 --- /dev/null +++ b/.github/workflows/gemini-release.yml @@ -0,0 +1,34 @@ +name: Gemini release archive + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Check the manifest version matches the tag + env: + TAG: ${{ github.event.release.tag_name }} + run: | + version="$(jq -r .version plugins/obsidian/gemini-extension.json)" + if [[ "$version" != "${TAG#v}" ]]; then + echo "gemini-extension.json is $version but the release tag is $TAG" >&2 + exit 1 + fi + + - run: ./scripts/package-gemini.sh dist/obsidian-gemini.tar.gz + + - name: Attach the archive to the release + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.event.release.tag_name }} + run: gh release upload "$TAG" dist/obsidian-gemini.tar.gz --clobber diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/README.md b/README.md index 59e4fab..47a0ae6 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,12 @@ To use ssh instead, if you have a GitHub SSH key set up: npx skills add git@github.com:obsidianmd/obsidian-skills.git ``` +### Gemini CLI + +```sh +gemini extensions install https://github.com/obsidianmd/obsidian-skills +``` + ### Manually #### Claude Code @@ -78,6 +84,8 @@ Update the plugin version in every manifest with: The script also accepts `major`, `minor`, or an explicit version like `1.1.0`. +Gemini CLI installs from the latest GitHub release, so publish a release for each version, tagged with the version number. The `Gemini release archive` workflow then attaches `obsidian-gemini.tar.gz`, which has real copies of the skills. Don't attach other files to a release, because Gemini CLI only picks a file when there's exactly one; otherwise it falls back to the source archive, which has no Gemini manifest. To build the archive locally, run `./scripts/package-gemini.sh`. + ## Skills | Skill | Description | diff --git a/plugins/obsidian/gemini-extension.json b/plugins/obsidian/gemini-extension.json new file mode 100644 index 0000000..c8d793e --- /dev/null +++ b/plugins/obsidian/gemini-extension.json @@ -0,0 +1,5 @@ +{ + "name": "obsidian", + "version": "1.2.0", + "description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates." +} diff --git a/scripts/bump.sh b/scripts/bump.sh index 7e36c55..b3135f8 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -12,6 +12,7 @@ files=( "plugins/obsidian/plugin.json" "plugins/obsidian/.claude-plugin/plugin.json" "plugins/obsidian/.cursor-plugin/plugin.json" + "plugins/obsidian/gemini-extension.json" ".claude-plugin/marketplace.json" ) diff --git a/scripts/package-gemini.sh b/scripts/package-gemini.sh new file mode 100755 index 0000000..252d0cb --- /dev/null +++ b/scripts/package-gemini.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/.." + +out="${1:-dist/obsidian-gemini.tar.gz}" +plugin="plugins/obsidian" + +stage="$(mktemp -d)" +trap 'rm -rf "$stage"' EXIT + +cp "$plugin/gemini-extension.json" "$plugin/LICENSE" "$stage/" +# Gemini copies an installed extension with fs.cp, which breaks symlinks, so the archive needs real files. +cp -RL "$plugin/skills" "$stage/skills" + +mkdir -p "$(dirname "$out")" +tar -czf "$out" -C "$stage" gemini-extension.json LICENSE skills + +echo "Wrote $out"