Skip to content

Commit da28e96

Browse files
authored
chore: enable trusted publishing for npm packages (#1147)
1 parent 4fe09ae commit da28e96

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: Release
2929
if: github.repository == 'web-infra-dev/rslib' && github.event_name == 'workflow_dispatch'
3030
runs-on: ubuntu-latest
31-
environment: production
31+
environment: npm
3232
steps:
3333
- name: Checkout
3434
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -47,12 +47,15 @@ jobs:
4747
node-version: 22
4848
cache: 'pnpm'
4949

50+
# Update npm to the latest version to enable OIDC
51+
- name: Update npm
52+
run: |
53+
npm install -g npm@latest
54+
npm --version
55+
5056
- name: Install Dependencies
5157
run: pnpm install
5258

5359
- name: Publish to npm
54-
env:
55-
NPM_TOKEN: ${{ secrets.RSLIB_NPM_TOKEN }}
5660
run: |
57-
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
5861
pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
},
8181
"publishConfig": {
8282
"access": "public",
83-
"provenance": true,
8483
"registry": "https://registry.npmjs.org/"
8584
}
8685
}

packages/create-rslib/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
},
4747
"publishConfig": {
4848
"access": "public",
49-
"provenance": true,
5049
"registry": "https://registry.npmjs.org/"
5150
}
5251
}

packages/plugin-dts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
},
6363
"publishConfig": {
6464
"access": "public",
65-
"provenance": true,
6665
"registry": "https://registry.npmjs.org/"
6766
}
6867
}

0 commit comments

Comments
 (0)