Create main.yml

This commit is contained in:
maigamo 2025-06-23 15:48:01 +08:00 committed by GitHub
parent b9880e86a7
commit 2fe3566a08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

40
.github/workflows/main.yml vendored Normal file
View file

@ -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)