ci: group dependabot prs and run lint&build for every push&pr (#233)

* ci: group all non-major deps for dependabot

closes: #222

* ci: run lint and build on every push

* ci: upload xpi to artifact

* ci: fix lint:check script

* ci: fix dist path
This commit is contained in:
Northword 2024-12-30 22:36:39 +08:00 committed by GitHub
parent 0fd238cfac
commit 7f062b198a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 73 additions and 2 deletions

View File

@ -9,3 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
all-non-major:
update-types:
- "minor"
- "patch"

65
.github/workflows/ci.yml vendored Normal file
View File

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

View File

@ -27,7 +27,7 @@ jobs:
node-version: 20
- name: Install deps
run: npm install -f
run: npm install
- name: Build
run: |

View File

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