Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: "0 0 * * 0"
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
CI: true
FORCE_COLOR: 2
NODE_COV: "lts/*" # The Node.js version to run coveralls on

permissions:
contents: read
Expand All @@ -27,20 +26,17 @@ jobs:
- run: npm run lint

test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
name: Node ${{ matrix.node }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node:
- 16
- 18
- 20
- "lts/*"
- 22
- 24
- lts/*

steps:
- uses: actions/checkout@v6
Expand All @@ -51,18 +47,4 @@ jobs:
cache: npm
- run: npm ci
- run: npm run build --if-present

- name: Run Jest
run: npm run test:jest
if: matrix.node != env.NODE_COV

- name: Run Jest with coverage
run: npm run test:jest -- --coverage
if: matrix.node == env.NODE_COV

- name: Run Coveralls
uses: coverallsapp/github-action@v2.3.7
if: matrix.node == env.NODE_COV
continue-on-error: true
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: npm run test:vi
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish
on:
push:
tags:
- "v*"

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: lts/*
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: npm ci

- name: Create jsr.json based on package.json
run: |
node --input-type=module -e '
import { readFileSync, writeFileSync } from "fs";
const p = JSON.parse(readFileSync("./package.json", "utf8"));
const jsrJson = {
name: `@cheerio/${p.name}`,
version: p.version,
exports: { ".": "./src/index.ts" },
};
writeFileSync("./jsr.json", JSON.stringify(jsrJson, null, 2));
'

- name: Publish package to JSR
run: npx jsr publish

- name: Publish package to npm
run: npm publish --provenance --access public
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
coverage/
lib/
dist/
docs/
jsr.json
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
Loading
Loading