Skip to content

Commit 42fed98

Browse files
committed
chore(workflow): enable npm trusted publishing
1 parent 6c45ea1 commit 42fed98

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,20 @@ on:
3737
default: false
3838

3939
permissions:
40+
contents: write
4041
# To publish packages with provenance
4142
id-token: write
4243

4344
jobs:
4445
release:
4546
name: Release
46-
permissions:
47-
contents: write
48-
# To publish packages with provenance
49-
id-token: write
5047
runs-on: ubuntu-latest
51-
48+
environment: npm
5249
steps:
5350
- name: Checkout
5451
uses: actions/checkout@v4
5552

56-
- name: Install Pnpm
53+
- name: Setup Pnpm
5754
run: |
5855
npm install -g corepack@latest
5956
corepack enable
@@ -64,6 +61,12 @@ jobs:
6461
node-version: 20
6562
cache: "pnpm"
6663

64+
# Update npm to the latest version to enable OIDC
65+
- name: Update npm
66+
run: |
67+
npm install -g npm@latest
68+
npm --version
69+
6770
- name: Install Dependencies
6871
run: pnpm install
6972

@@ -76,6 +79,3 @@ jobs:
7679
DRY_RUN: ${{ inputs.dry_run }}
7780
TAG: ${{ inputs.tag }}
7881
VERSION: ${{ inputs.version }}
79-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
80-
81-

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"types": "./dist/index.d.ts",
88
"publishConfig": {
99
"access": "public",
10-
"registry": "https://registry.npmjs.org/",
11-
"provenance": true
10+
"registry": "https://registry.npmjs.org/"
1211
},
1312
"exports": {
1413
".": {

0 commit comments

Comments
 (0)