Skip to content

Commit 8853605

Browse files
committed
ci: activate corepack npm after yarn steps in alpha publish
Enabling the corepack npm shim before `yarn install` makes it intercept the yarn invocation and fail with a bogus 'packageManager: yarn@npm@11.5.1' error. Move the corepack npm activation to just before `npm publish`, after all yarn steps, since npm >=11.5.1 is only needed for the OIDC publish.
1 parent 78422d4 commit 8853605

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/release_alpha.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ jobs:
5252
# installer changes.
5353
node-version: 22.14.0
5454
registry-url: "https://registry.npmjs.org"
55-
- name: Activate npm via corepack
56-
# Node 22 ships npm 10.x; Trusted Publishing needs >=11.5.1. corepack
57-
# fetches a fresh npm binary, avoiding the broken self-upgrade path.
58-
run: |
59-
corepack enable npm
60-
corepack prepare npm@11.5.1 --activate
61-
npm --version
6255
- name: Run install
6356
run: yarn install --frozen-lockfile
6457
- name: Build
@@ -91,6 +84,14 @@ jobs:
9184
git tag -a "${TAG}" -m "${TAG}"
9285
git push origin "${TAG}"
9386
fi
87+
- name: Activate npm via corepack
88+
# Done AFTER all yarn steps: enabling the corepack npm shim earlier makes
89+
# it intercept `yarn` and fail. Node 22 ships npm 10.x; Trusted Publishing
90+
# needs >=11.5.1, so activate it just before publishing.
91+
run: |
92+
corepack enable npm
93+
corepack prepare npm@11.5.1 --activate
94+
npm --version
9495
- name: Publish to npm with provenance (OIDC)
9596
# No NPM_TOKEN: auth is the OIDC handshake configured as a Trusted
9697
# Publisher on npmjs.com. --access public because @reearth/core is scoped.

0 commit comments

Comments
 (0)