Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
types: [released]

permissions:
contents: read
contents: read
# Required for npm trusted publishing (OIDC) and provenance attestations
id-token: write

env:
HYPHEN_PUBLIC_API_KEY: ${{ secrets.HYPHEN_PUBLIC_API_KEY }}
Expand All @@ -31,20 +33,23 @@ jobs:
with:
node-version: 22
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: pnpm install

- name: Build
- name: Build
run: pnpm build

- name: Testing
- name: Testing
run: pnpm test

- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Trusted publishing (OIDC) requires npm CLI >= 11.5.1, which is newer than
# the version bundled with Node.js 22.
- name: Update npm
run: npm install -g npm@latest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pnpm instead. add in pnpm/setup action


- name: Publish
# No NPM_TOKEN: authentication is handled via OIDC trusted publishing.
# Provenance attestations are generated from the OIDC identity.
run: npm publish --provenance --ignore-scripts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pnpm

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"name": "@hyphen/sdk",
"version": "3.1.0",
"description": "Hyphen SDK for Node.js",
"repository": {
"type": "git",
"url": "git+https://github.com/Hyphen/nodejs-sdk.git"
},
"homepage": "https://github.com/Hyphen/nodejs-sdk#readme",
"bugs": {
"url": "https://github.com/Hyphen/nodejs-sdk/issues"
},
"type": "module",
"packageManager": "pnpm@11.6.0",
"main": "dist/index.cjs",
Expand Down