From 2e9646589c8e365816184212fba8b1335fed6e42 Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 30 Dec 2024 20:23:30 +0800 Subject: [PATCH 1/5] ci: group all non-major deps for dependabot closes: #222 --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) 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" From de005b2cc2be970028fbd73c265e0fb3f2cef54a Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 30 Dec 2024 20:24:00 +0800 Subject: [PATCH 2/5] ci: run lint and build on every push --- .github/workflows/ci.yml | 58 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 2 +- package.json | 3 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0c1316d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +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 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..4e6951a 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 --write . && eslint . --fix", + "lint:fix": "prettier --write . && eslint . --fix", "release": "zotero-plugin release", "test": "echo \"Error: no test specified\" && exit 1", "update-deps": "npm update --save" From 4a21c9be91286985ed674ded128c34f59d5ea2d2 Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 30 Dec 2024 20:30:28 +0800 Subject: [PATCH 3/5] ci: upload xpi to artifact --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c1316d..4ef99d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,3 +56,10 @@ jobs: - name: Run Build run: | npm run build + + - name: Upload build result + uses: actions/upload-artifact@v4 + with: + name: build-result + path: | + dist From 61440f7fc51bacc5aee463d1f432c2fd789accc0 Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 30 Dec 2024 20:32:04 +0800 Subject: [PATCH 4/5] ci: fix lint:check script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e6951a..e1a3b59 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "scripts": { "start": "zotero-plugin serve", "build": "tsc --noEmit && zotero-plugin build", - "lint:check": "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", From ad05d2190d94cf3462cd2c89ef08ef008a2d083d Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 30 Dec 2024 20:33:23 +0800 Subject: [PATCH 5/5] ci: fix dist path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ef99d6..2d93df8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,4 +62,4 @@ jobs: with: name: build-result path: | - dist + build