Skip to content

Commit 27fa3d0

Browse files
authored
chore: publish to JSR (#9)
* chore: publish to JSR on main Made-with: Cursor * chore: consolidate publish workflow to npm+jsr Made-with: Cursor
1 parent d273e81 commit 27fa3d0

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to npm on GitHub Release
1+
name: Publish
22

33
on:
44
release:
@@ -12,8 +12,7 @@ jobs:
1212
publish:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1716

1817
- name: Setup Node
1918
uses: actions/setup-node@v4
@@ -22,19 +21,28 @@ jobs:
2221
registry-url: https://registry.npmjs.org
2322
cache: npm
2423

25-
- name: Ensure release tag matches package.json version
24+
- name: Ensure versions match
2625
shell: bash
2726
run: |
2827
set -euo pipefail
2928
PKG_VERSION="$(node -p "require('./package.json').version")"
29+
JSR_VERSION="$(node -p "require('./jsr.json').version")"
3030
TAG_NAME="${{ github.event.release.tag_name }}"
31+
if [[ "$PKG_VERSION" != "$JSR_VERSION" ]]; then
32+
echo "Version mismatch: package.json=$PKG_VERSION, jsr.json=$JSR_VERSION"
33+
exit 1
34+
fi
3135
if [[ "$TAG_NAME" != "v$PKG_VERSION" && "$TAG_NAME" != "$PKG_VERSION" ]]; then
32-
echo "Release tag '$TAG_NAME' does not match package.json version '$PKG_VERSION' (expected '$PKG_VERSION' or 'v$PKG_VERSION')."
36+
echo "Release tag '$TAG_NAME' does not match version '$PKG_VERSION' (expected '$PKG_VERSION' or 'v$PKG_VERSION')."
3337
exit 1
3438
fi
3539
3640
- name: Install dependencies
3741
run: npm install --ignore-scripts
3842

39-
- name: Publish
43+
- name: Publish to npm
4044
run: npm publish --access public --provenance
45+
46+
- name: Publish to JSR
47+
run: npx jsr publish
48+

jsr.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "@proxymesh/javascript-proxy-headers",
3+
"version": "0.1.0",
4+
"license": "MIT",
5+
"exports": "./mod.ts"
6+
}
7+

mod.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// JSR entrypoint: re-export the public API from the JS module.
2+
export * from "./index.js";
3+

0 commit comments

Comments
 (0)