Skip to content

Commit 211256d

Browse files
committed
ci(publish): Enable npm provenance and harden package scripts
- Add registry-url to setup-node step so NODE_AUTH_TOKEN is set automatically - Switch npm publish to --provenance for signed, verifiable package releases - Consolidate preinstall/postinstall/prepare into a single prepare script - Add || true guard so simple-git-hooks does not fail in CI environments
1 parent c7b2817 commit 211256d

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- uses: actions/setup-node@v4
2020
with:
2121
node-version: '22'
22+
registry-url: 'https://registry.npmjs.org'
2223

2324
- run: npm install -g npm@latest
2425
- run: corepack enable
@@ -56,9 +57,7 @@ jobs:
5657
env:
5758
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5859

59-
- run: npm publish --access public
60-
env:
61-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
- run: npm publish --access public --provenance
6261

6362
python-wheels:
6463
strategy:

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
],
2020
"sideEffects": false,
2121
"scripts": {
22-
"preinstall": "npx only-allow yarn",
23-
"postinstall": "simple-git-hooks",
24-
"prepare": "simple-git-hooks",
22+
"prepare": "simple-git-hooks || true",
2523
"build": "yarn build:wasm && yarn build:js",
2624
"build:wasm": "emcmake cmake -B build-wasm -DBUILD_WASM=ON && cmake --build build-wasm",
2725
"build:js": "tsc",

0 commit comments

Comments
 (0)