From e35263818304513cbb2401ec6545bb99bb51a165 Mon Sep 17 00:00:00 2001 From: ashwin271 Date: Fri, 10 Jan 2025 23:55:25 +0530 Subject: [PATCH] Refactor VectorSearchPlugin to remove minimum version check and add GitHub Actions workflow for releases --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ main.ts | 7 ------- 2 files changed, 35 insertions(+), 7 deletions(-) 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..27e5657 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release Obsidian plugin + +on: + push: + tags: + - "*" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: "18.x" + + - name: Build plugin + run: | + npm install + npm run build + + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tag="${GITHUB_REF#refs/tags/}" + + gh release create "$tag" \ + --title="$tag" \ + --draft \ + main.js manifest.json styles.css diff --git a/main.ts b/main.ts index a69b10c..5bb233c 100644 --- a/main.ts +++ b/main.ts @@ -28,18 +28,11 @@ const DEFAULT_SETTINGS: MyPluginSettings = { modelName: 'nomic-embed-text' } -const MINIMUM_OBSIDIAN_VERSION = '0.15.0'; - export default class VectorSearchPlugin extends Plugin { settings: MyPluginSettings; vectorStore: Map = new Map(); async onload() { - // Version check - if (this.compareVersions(this.app.version, MINIMUM_OBSIDIAN_VERSION) < 0) { - new Notice(`Vector Search requires Obsidian ${MINIMUM_OBSIDIAN_VERSION} or higher`); - return; - } await this.loadSettings();