diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1901ba7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Obsidian Plugin CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build-and-lint: + name: Lint & Build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint code + run: npx eslint ./src --ext .ts + + - name: Type check + run: npx tsc --noEmit + + - name: Build plugin (production) + run: node esbuild.config.mjs production + + - name: Check output files + run: | + ls -lh + test -f main.js || (echo "❌ main.js not found after build" && exit 1) + test -f manifest.json || (echo "❌ manifest.json not found" && exit 1)