Skip to content

Commit cef6918

Browse files
Merge pull request #58 from ipdata/trusted-publishing
Publish to npm through trusted publishing
2 parents b7fef66 + 78b90cb commit cef6918

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ on:
1010
description: Tag to publish, for example v3.1.0
1111
required: true
1212
type: string
13+
workflow_dispatch:
14+
inputs:
15+
tag:
16+
description: Tag to publish, for example v3.1.0
17+
required: true
18+
type: string
1319

1420
jobs:
1521
lint:
@@ -60,11 +66,14 @@ jobs:
6066
with:
6167
node-version: '22'
6268
registry-url: 'https://registry.npmjs.org'
69+
# Publishing authenticates with the job's OpenID Connect token through the
70+
# package's trusted publisher configuration on npmjs.com; no npm token is
71+
# stored in the repository. The OIDC flow needs npm 11.5.1 or newer.
72+
- name: Update npm
73+
run: npm install -g npm@latest
6374
- name: Install dependencies
6475
run: npm ci
6576
- name: Build
6677
run: npm run build
6778
- name: Release
6879
run: npm publish --provenance --access public
69-
env:
70-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)