12.0.0 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| 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", | |
| "./WritableStream": "./src/WritableStream.ts", | |
| }, | |
| imports: { | |
| "domelementtype": `jsr:@cheerio/domelementtype@${p.dependencies.domelementtype}`, | |
| "domhandler": `jsr:@cheerio/domhandler@${p.dependencies.domhandler}`, | |
| "domutils": `jsr:@cheerio/domutils@${p.dependencies.domutils}`, | |
| "entities": `jsr:@cheerio/entities@${p.dependencies.entities}`, | |
| }, | |
| }; | |
| 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 |