Skip to content

Commit 5c74527

Browse files
committed
Switch npm publish from token auth to OIDC trusted publishing
1 parent e579946 commit 5c74527

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ jobs:
8888
- name: Build
8989
run: pnpm build
9090

91+
- name: Upgrade npm for trusted publishing
92+
run: npm i -g [email protected]
93+
9194
- name: Create and publish versions
9295
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
9396
with:
9497
title: "Release new version"
9598
commit: "update version"
96-
publish: pnpm publish --provenance
99+
publish: pnpm publish:ci
97100
env:
98101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
100-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
102+
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "nextjs-basic-auth-middleware",
33
"version": "3.1.0",
44
"author": "Boris Besemer",
5+
"publishConfig": {
6+
"access": "public",
7+
"registry": "https://registry.npmjs.org/"
8+
},
59
"module": "dist/index.js",
610
"homepage": "https://github.com/labd/nextjs-basic-auth-middleware#readme",
711
"repository": {
@@ -30,7 +34,8 @@
3034
"lint:fix": "biome check --write .",
3135
"test": "vitest run",
3236
"test:ci": "vitest run --coverage",
33-
"tsc": "tsc --noEmit -p ."
37+
"tsc": "tsc --noEmit -p .",
38+
"publish:ci": "pnpm build && pnpm changeset publish"
3439
},
3540
"peerDependencies": {
3641
"next": ">=13.1"

0 commit comments

Comments
 (0)