diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2545cdf9..4a0dd1b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,3 +54,18 @@ jobs: run: npm install eslint@${{ matrix.eslint }} - name: Test run: npm run test + + jsr_test: + name: Verify JSR Publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "lts/*" + - name: Install Packages + run: npm install + - name: Run --dry-run + run: | + npm run build + npm run test:jsr diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3eba292a..38f05989 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,13 +20,20 @@ jobs: node-version: lts/* registry-url: https://registry.npmjs.org if: ${{ steps.release.outputs.release_created }} - - run: | + - name: Publish to npm + run: | npm install npm run build --if-present npm publish --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} if: ${{ steps.release.outputs.release_created }} + - name: Publish to JSR + run: | + npm run build --if-present + npx jsr publish + if: ${{ steps.release.outputs.release_created }} + - run: 'npx @humanwhocodes/tweet "eslint/markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' if: ${{ steps.release.outputs.release_created }} env: diff --git a/jsr.json b/jsr.json new file mode 100644 index 00000000..0de9a133 --- /dev/null +++ b/jsr.json @@ -0,0 +1,14 @@ +{ + "name": "@eslint/markdown", + "version": "6.0.0", + "exports": "./dist/esm/index.js", + "publish": { + "include": [ + "dist/esm/index.js", + "dist/esm/index.d.ts", + "README.md", + "jsr.json", + "LICENSE" + ] + } +} diff --git a/package.json b/package.json index d1c5edba..17264ea5 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "build:rules": "node tools/build-rules.js", "build": "npm run build:rules && rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json", "prepare": "node ./npm-prepare.cjs && npm run build", - "test": "c8 mocha \"tests/**/*.test.js\" --timeout 30000" + "test": "c8 mocha \"tests/**/*.test.js\" --timeout 30000", + "test:jsr": "npx jsr@latest publish --dry-run" }, "devDependencies": { "@eslint/core": "^0.3.0",