mirror of
https://github.com/ashwin271/obsidian-vector-search.git
synced 2026-07-22 11:50:31 +00:00
Refactor VectorSearchPlugin to remove minimum version check and add GitHub Actions workflow for releases
This commit is contained in:
parent
391cb33ce5
commit
e352638183
2 changed files with 35 additions and 7 deletions
35
.github/workflows/release.yml
vendored
Normal file
35
.github/workflows/release.yml
vendored
Normal file
|
|
@ -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
|
||||
7
main.ts
7
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<string, number[]> = 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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue