diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e615d14..4de70a29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,3 +71,17 @@ 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 d2758744..ba7a9b65 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..d94f4520 --- /dev/null +++ b/jsr.json @@ -0,0 +1,16 @@ +{ + "name": "@eslint/markdown", + "version": "6.0.0", + "exports": "./dist/esm/index.js", + "publish": { + "include": [ + "dist/esm/index.js", + "dist/esm/index.d.ts", + "dist/esm/types.ts", + "dist/esm/types.d.ts", + "README.md", + "jsr.json", + "LICENSE" + ] + } +} diff --git a/package.json b/package.json index 58f937fd..4051c951 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,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", diff --git a/release-please-config.json b/release-please-config.json index 49024064..82e21773 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,7 +4,15 @@ "release-type": "node", "pull-request-title-pattern": "chore: release ${version} 🚀", "include-component-in-tag": false, - "extra-files": ["src/index.js", "src/processor.js"] + "extra-files": [ + "src/index.js", + "src/processor.js", + { + "type": "json", + "path": "jsr.json", + "jsonpath": "$.version" + } + ] } } }