Skip to content

Commit 6f1fa86

Browse files
hyperpolymathclaude
andcommitted
fix(ci): publish to JSR (Deno project), not npm — repair broken publish
preference-injector is Deno + ReScript (deno.json, JSR name, NO package.json), but publish.yml ran 'npm ci / npm publish' — which can never work without a package.json (this is why the failure only ever surfaced at release time). The correct registry is JSR. Switches publish.yml to setup-deno -> deno task build -> deno publish, with id-token: write so JSR records build provenance natively. Adds the required 'exports' to deno.json (was missing, so JSR couldn't resolve the entry). NOTE: first release will validate the build chain — 'deno task build' runs 'rescript build', which needs the ReScript toolchain available in CI; if that toolchain isn't wired (no package.json to install rescript from), that's a pre-existing build gap to close separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3c277ec commit 6f1fa86

2 files changed

Lines changed: 44 additions & 29 deletions

File tree

.github/workflows/publish.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,26 @@ on:
88
release:
99
types: [created]
1010

11+
# This is a Deno + ReScript project (deno.json, JSR name @hyperpolymath/
12+
# preference-injector, no package.json) — it publishes to JSR, not npm. The
13+
# previous npm publish could never run (npm needs a package.json). JSR records
14+
# build provenance natively from the OIDC token (id-token: write below).
1115
jobs:
12-
publish-npm:
16+
publish-jsr:
1317
runs-on: ubuntu-latest
1418
timeout-minutes: 15
1519
permissions:
1620
contents: read
17-
id-token: write
18-
21+
id-token: write # JSR build provenance is minted from this
1922
steps:
2023
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
21-
22-
- name: Setup Node.js
23-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
24+
- name: Setup Deno
25+
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
2426
with:
25-
node-version: '20.x'
26-
registry-url: 'https://registry.npmjs.org'
27-
28-
- name: Install dependencies
29-
run: npm ci
30-
31-
- name: Run tests
32-
run: npm test
33-
34-
- name: Build
35-
run: npm run build
36-
37-
- name: Publish to npm
38-
run: npm publish --provenance --access public
39-
env:
40-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
deno-version: v2.x
28+
- name: Build (ReScript -> JS)
29+
run: deno task build
30+
- name: Test
31+
run: deno task test
32+
- name: Publish to JSR
33+
run: deno publish

deno.json

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@hyperpolymath/preference-injector",
33
"version": "2.0.0",
4+
"exports": "./src/rescript/PreferenceInjector.bs.js",
45
"tasks": {
56
"dev": "deno run --watch --allow-all src/rescript/PreferenceInjector.bs.js",
67
"start": "deno run --allow-all src/rescript/PreferenceInjector.bs.js",
@@ -22,7 +23,10 @@
2223
"pqc-kyber": "npm:pqc-kyber@1.0.0"
2324
},
2425
"compilerOptions": {
25-
"lib": ["deno.window", "deno.unstable"],
26+
"lib": [
27+
"deno.window",
28+
"deno.unstable"
29+
],
2630
"strict": true,
2731
"allowJs": true,
2832
"checkJs": false
@@ -34,16 +38,34 @@
3438
"semiColons": true,
3539
"singleQuote": true,
3640
"proseWrap": "preserve",
37-
"include": ["src/", "tests/", "examples/", "scripts/"],
38-
"exclude": ["*.bs.js"]
41+
"include": [
42+
"src/",
43+
"tests/",
44+
"examples/",
45+
"scripts/"
46+
],
47+
"exclude": [
48+
"*.bs.js"
49+
]
3950
},
4051
"lint": {
4152
"rules": {
42-
"tags": ["recommended"],
43-
"exclude": ["no-unused-vars"]
53+
"tags": [
54+
"recommended"
55+
],
56+
"exclude": [
57+
"no-unused-vars"
58+
]
4459
},
45-
"include": ["src/", "tests/", "examples/", "scripts/"],
46-
"exclude": ["*.bs.js"]
60+
"include": [
61+
"src/",
62+
"tests/",
63+
"examples/",
64+
"scripts/"
65+
],
66+
"exclude": [
67+
"*.bs.js"
68+
]
4769
},
4870
"lock": false
4971
}

0 commit comments

Comments
 (0)