diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3a3cce5..3dcce0c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + groups: + all-non-major: + update-types: + - "minor" + - "patch" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2d93df8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install deps + run: | + npm install + + - name: Run Lint + run: | + npm run lint:check + + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install deps + run: | + npm install + + - name: Run Build + run: | + npm run build + + - name: Upload build result + uses: actions/upload-artifact@v4 + with: + name: build-result + path: | + build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e9b4eb..1e5f066 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: node-version: 20 - name: Install deps - run: npm install -f + run: npm install - name: Build run: | diff --git a/package.json b/package.json index 96780b8..e1a3b59 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "scripts": { "start": "zotero-plugin serve", "build": "tsc --noEmit && zotero-plugin build", - "lint": "prettier --write . && eslint . --fix", + "lint:check": "prettier --check . && eslint .", + "lint:fix": "prettier --write . && eslint . --fix", "release": "zotero-plugin release", "test": "echo \"Error: no test specified\" && exit 1", "update-deps": "npm update --save"