Skip to content

Commit fbd7c21

Browse files
authored
chore(ci): use npm trusted publish (#11343)
* chore: use npm oidc * feat: use npm trusted publish
1 parent 9be4843 commit fbd7c21

File tree

4 files changed

+25
-162
lines changed

4 files changed

+25
-162
lines changed

.github/workflows/release-canary.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
name: Release Canary
7676
runs-on: ubuntu-latest
7777
needs: build
78+
environment: npm-canary
7879
steps:
7980
- name: Checkout Branch
8081
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -105,10 +106,14 @@ jobs:
105106
- name: Resolve dependencies for bindings
106107
run: pnpm install --no-frozen-lockfile
107108

109+
# Update npm to the latest version to enable OIDC
110+
- name: Update npm
111+
run: |
112+
npm install -g npm@latest
113+
npm --version
114+
108115
- name: Release
109116
run: |
110117
./x version snapshot
111118
pnpm run build:js:canary
112119
./x publish snapshot --tag latest
113-
env:
114-
NPM_TOKEN: ${{ secrets.RSPACK_CANARY_RELEASE_TOKEN }}

.github/workflows/release-debug.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
name: Release Debug
3131
runs-on: ubuntu-latest
3232
needs: build
33+
environment: npm-canary
3334
steps:
3435
- name: Checkout Branch
3536
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -60,10 +61,14 @@ jobs:
6061
- name: Resolve dependencies for bindings
6162
run: pnpm install --no-frozen-lockfile
6263

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+
6370
- name: Release Debug
6471
run: |
6572
pnpm run build:js
6673
./x version debug
6774
./x publish stable --tag latest
68-
env:
69-
NPM_TOKEN: ${{ secrets.RSPACK_CANARY_RELEASE_TOKEN }}

.github/workflows/release-otp.yml

Lines changed: 0 additions & 157 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- latest
1515
- beta
1616
- alpha
17+
- rc
1718
test:
1819
type: boolean
1920
description: "Run tests before release"
@@ -78,6 +79,7 @@ jobs:
7879

7980
release:
8081
name: Release
82+
environment: npm
8183
permissions:
8284
contents: write
8385
# To publish packages with provenance
@@ -103,6 +105,9 @@ jobs:
103105
with:
104106
path: artifacts
105107

108+
- name: Clean artifacts
109+
run: find artifacts -type f -name '*.d.ts' | xargs rm -f
110+
106111
- name: Build node packages
107112
run: pnpm run build:js
108113

@@ -115,11 +120,16 @@ jobs:
115120
- name: Link optional dependencies
116121
run: pnpm install --no-frozen-lockfile
117122

123+
# Update npm to the latest version to enable OIDC
124+
- name: Update npm
125+
run: |
126+
npm install -g npm@latest
127+
npm --version
128+
118129
- name: Release Full
119130
run: |
120131
./x publish stable --tag ${{inputs.tag}} ${{inputs.dry_run && '--dry-run' || '--no-dry-run'}} ${{inputs.push_tags && '--push-tags' || '--no-push-tags'}}
121132
env:
122-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
123133
REPOSITORY: ${{ github.repository }}
124134
REF: ${{ github.ref }}
125135
ONLY_RELEASE_TAG: true

0 commit comments

Comments
 (0)