blamouche_obsidian-any-ai-code/.github/workflows/release.yml
blamouche 8100cecd42 Align plugin with Obsidian community submission guidelines
Audit-driven fixes for community-store submission:
- Add a top-level MIT LICENSE so the license is discoverable next to
  the manifest and README.
- Remove leaf.detach() from onunload — the plugin guidelines
  explicitly require not detaching custom-view leaves on unload so
  Obsidian preserves leaf placement across reloads.
- Settings tab UI text guidelines:
  - Drop the top-level plugin-name <h2> heading.
  - Drop the redundant heading on the first general section
    (general settings now sit at the top with no heading, per the
    "Only use headings under settings if you have more than one
    section" rule).
  - Replace remaining <h3> elements with
    new Setting(containerEl).setName(...).setHeading() so headings
    inherit Obsidian's setting-heading styling.
- Release workflow now creates drafts (draft: true), matching the
  official "Release your plugin with GitHub Actions" guide so the
  author reviews release notes before publishing.
- Tighten manifest description to a clearer action statement that
  avoids the "OpenAI" parsing ambiguity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 08:24:41 +02:00

93 lines
3 KiB
YAML

name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
env:
PLUGIN_ID: obsidian-any-ai-code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Stage plugin bundle
run: |
set -e
STAGE_DIR="dist/${PLUGIN_ID}"
mkdir -p "${STAGE_DIR}"
# Files required at runtime by the plugin (see README "Install in a Vault").
# node-pty is a native module: ship package.json + package-lock.json so
# the user installs it for their own platform via `npm install --omit=dev`.
for f in manifest.json main.js styles.css versions.json pty-proxy.js pty-bridge.py package.json package-lock.json; do
if [ ! -f "$f" ]; then
echo "Missing required plugin file: $f"
exit 1
fi
cp "$f" "${STAGE_DIR}/"
done
- name: Create plugin zip
run: |
set -e
cd dist
zip -r "../${PLUGIN_ID}-${GITHUB_REF_NAME}.zip" "${PLUGIN_ID}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
# Per Obsidian release guide, releases are created as drafts so the
# author can review release notes before publishing.
draft: true
body: |
## Install
1. Download `${{ env.PLUGIN_ID }}-${{ github.ref_name }}.zip` below.
2. Unzip it inside your vault's plugin folder so the resulting path is `/PATH/TO/VAULT/.obsidian/plugins/${{ env.PLUGIN_ID }}/`.
3. Enable the plugin in Obsidian → Settings → Community plugins.
No commands required. The plugin uses an embedded Python PTY bridge fallback so it works out of the box on macOS / Linux, and falls back to direct pipe mode on Windows.
### Optional — native PTY backend
For best terminal fidelity (full-screen TUI rendering, resize), install the native `node-pty` module after unzipping:
```bash
cd "/PATH/TO/VAULT/.obsidian/plugins/${{ env.PLUGIN_ID }}"
npm install --omit=dev
```
Then reload the plugin.
### Manual install / Obsidian auto-update
`main.js`, `manifest.json`, and `styles.css` are also attached as standalone files for compatibility with Obsidian's plugin update protocol and tools like BRAT.
files: |
${{ env.PLUGIN_ID }}-${{ github.ref_name }}.zip
main.js
manifest.json
styles.css
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}