From b7cf858c1c41bb63bb2347724700fbe6ca40d38d Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 26 Oct 2025 11:50:37 -0400 Subject: [PATCH 1/3] feat: add GitHub Actions release workflow Implements automated release workflow per design document. - Triggers on semantic version tags (e.g., 1.2.3) - Validates version consistency across package.json, manifest.json, and git tag - Runs test suite (blocks release if tests fail) - Builds plugin using production build process - Verifies build artifacts exist (main.js, manifest.json, styles.css) - Creates draft GitHub release with required files Workflow uses single-job architecture for simplicity and runs on Node.js 18 with npm caching for performance. --- .github/workflows/release.yml | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..934c08e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +name: Release Plugin + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Validate version consistency + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/}" + PKG_VERSION=$(node -p "require('./package.json').version") + MANIFEST_VERSION=$(node -p "require('./manifest.json').version") + + echo "Checking version consistency..." + echo "Git tag: $TAG_VERSION" + echo "package.json: $PKG_VERSION" + echo "manifest.json: $MANIFEST_VERSION" + + if [ "$TAG_VERSION" != "$PKG_VERSION" ] || [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then + echo "❌ Version mismatch detected!" + echo "Git tag: $TAG_VERSION" + echo "package.json: $PKG_VERSION" + echo "manifest.json: $MANIFEST_VERSION" + exit 1 + fi + + echo "✅ All versions match: $TAG_VERSION" + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build plugin + run: npm run build + + - name: Verify build artifacts + run: | + echo "Verifying required files exist..." + + if [ ! -f main.js ]; then + echo "❌ main.js not found!" + exit 1 + fi + + if [ ! -f manifest.json ]; then + echo "❌ manifest.json not found!" + exit 1 + fi + + if [ ! -f styles.css ]; then + echo "❌ styles.css not found!" + exit 1 + fi + + echo "✅ All required files present" + echo "File sizes:" + ls -lh main.js manifest.json styles.css + + - name: Create draft release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/}" + + gh release create "$TAG_VERSION" \ + --title="$TAG_VERSION" \ + --draft \ + main.js \ + manifest.json \ + styles.css + + echo "✅ Draft release created: $TAG_VERSION" + echo "Visit https://github.com/${{ github.repository }}/releases to review and publish" From d0c2731816bc13e85915174c817c8eccf0f37f26 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 26 Oct 2025 11:53:34 -0400 Subject: [PATCH 2/3] fix: add release notes template to draft releases --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 934c08e..48a8e5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,19 @@ jobs: gh release create "$TAG_VERSION" \ --title="$TAG_VERSION" \ --draft \ + --notes="Release $TAG_VERSION + +## Changes + +*Add release notes here before publishing* + +## Installation + +1. Download \`main.js\`, \`manifest.json\`, and \`styles.css\` +2. Create a folder in \`.obsidian/plugins/obsidian-mcp-server/\` +3. Copy the three files into the folder +4. Reload Obsidian +5. Enable the plugin in Settings → Community Plugins" \ main.js \ manifest.json \ styles.css From 67c17869b87ce9e4537d58acbe2599517ff08996 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 26 Oct 2025 11:56:11 -0400 Subject: [PATCH 3/3] docs: add GitHub release workflow documentation --- CLAUDE.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index b42c835..4a14cc0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -234,6 +234,34 @@ This plugin is **desktop-only** (`isDesktopOnly: true`) because it uses Node.js - Create GitHub releases with tags that **exactly match** `manifest.json` version (no `v` prefix) - Attach required assets to releases: `manifest.json`, `main.js`, `styles.css` +#### GitHub Release Workflow + +A GitHub Actions workflow automatically handles releases: + +**Location**: `.github/workflows/release.yml` + +**Trigger**: Push of semantic version tags (e.g., `1.2.3`) + +**Process**: +1. Validates version consistency across `package.json`, `manifest.json`, and git tag +2. Runs full test suite (blocks release if tests fail) +3. Builds plugin with production config +4. Creates draft GitHub release with `main.js`, `manifest.json`, and `styles.css` + +**Developer workflow**: +```bash +npm version patch # or minor/major - updates manifest.json via version-bump.mjs +git commit -m "chore: bump version to X.Y.Z" +git tag X.Y.Z +git push && git push --tags # Triggers workflow +``` + +After workflow completes: +1. Go to GitHub Releases +2. Review draft release and attached files +3. Write release notes +4. Publish release + ### Build Artifacts - **Never commit build artifacts** to version control (`main.js`, `node_modules/`, etc.)