From d6a284c0655848fb55c51dbb9afd83564ca4e484 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 4 Aug 2025 17:54:28 +0800 Subject: [PATCH] chore: enable npm trusted publishing --- .github/workflows/release.yml | 17 +++++++++++------ package.json | 1 - 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a58b1d9..e9af016 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,19 +16,24 @@ permissions: jobs: publish: runs-on: ubuntu-latest - environment: production + environment: npm steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Pnpm - run: npm i -g corepack@latest --force && corepack enable - - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 - cache: "pnpm" + + # Update npm to the latest version to enable OIDC + # Use corepack to install pnpm + - name: Setup Package Managers + run: | + npm install -g npm@latest + npm --version + npm install -g corepack@latest --force + corepack enable - name: Install Dependencies run: pnpm install @@ -36,7 +41,7 @@ jobs: - name: Publish uses: JS-DevTools/npm-publish@v3 with: - token: ${{ secrets.CREATE_RSTACK_NPM_TOKEN }} + token: empty - name: Create GitHub Release uses: ncipollo/release-action@v1 diff --git a/package.json b/package.json index 3ea91f3..147e90e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "packageManager": "pnpm@10.12.4", "publishConfig": { "access": "public", - "provenance": true, "registry": "https://registry.npmjs.org/" } }