Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Fix release setup for pnpm 10 and 12 tags (#5439)
Andrew Mikofalvy25e9d5060543
diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjsindex 0b9e1f6e4..fc54dfb7b 100644--- a/.github/scripts/release-cascade-shape.test.mjs+++ b/.github/scripts/release-cascade-shape.test.mjs@@ -20,6 +20,10 @@ const promoteStable = read('promote-stable.yml');const releaseYml = read('release.yml');const bugLane = read('bug-lane.yml');const bugLaneVerify = read('bug-lane-verify.yml');+const tagCompatiblePnpmSetup =+ 'pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86';+const desktopReleaseRef = '${{ github.event.client_payload.release_tag || inputs.release_tag }}';+const publishRef = '${{ github.event.client_payload.ref || github.sha }}';const workflowStep = (source, workflowName, name) => {const start = source.indexOf(`- name: ${name}`);@@ -44,6 +48,49 @@ function stepNames(source) {const indexOfStep = (names, needle) => names.findIndex((n) => n.includes(needle));+describe('release jobs install the pnpm version declared by the checked-out tag', () => {+ const taggedJobs = [+ ['desktop-release.yml', desktopRelease, desktopReleaseRef],+ ['release.yml', releaseYml, publishRef],+ ].flatMap(([workflowName, source, expectedRef]) =>+ Object.entries(parse(source).jobs).flatMap(([jobName, job]) => {+ const steps = job.steps ?? [];+ return steps.some(+ (step) => step.uses?.startsWith('actions/checkout@') && step.with?.ref === expectedRef,+ )+ ? [[`${workflowName}#${jobName}`, steps, expectedRef]]+ : [];+ }),+ );++ test('retains the five existing release entry points', () => {+ expect(taggedJobs.map(([label]) => label)).toEqual(+ expect.arrayContaining([+ 'desktop-release.yml#prepare',+ 'desktop-release.yml#build-macos',+ 'desktop-release.yml#build-windows',+ 'desktop-release.yml#build-linux',+ 'release.yml#release',+ ]),+ );+ });++ test.each(taggedJobs)('%s supports both pnpm 10 and 12 tags', (label, steps, expectedRef) => {+ const checkout = steps.findIndex((step) => step.uses?.startsWith('actions/checkout@'));+ const setupNode = steps.findIndex((step) => step.uses?.startsWith('actions/setup-node@'));+ const pnpmSteps = steps.filter((step) => step.uses?.startsWith('pnpm/'));+ const setup = steps.indexOf(pnpmSteps[0]);++ expect(checkout, `${label} checkout`).toBeGreaterThan(-1);+ expect(steps[checkout].with.ref).toBe(expectedRef);+ expect(setupNode, `${label} Node setup`).toBeGreaterThan(-1);+ expect(pnpmSteps, `${label} pnpm setup`).toHaveLength(1);+ expect(setup).toBeGreaterThan(checkout);+ expect(pnpmSteps[0].uses).toBe(tagCompatiblePnpmSetup);+ expect(pnpmSteps[0].with).toBeUndefined();+ });+});+function stepLevelIfConditions(source) {const lines = source.split('\n');const out = [];diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.ymlindex b8fc718ec..1ceab368e 100644--- a/.github/workflows/desktop-release.yml+++ b/.github/workflows/desktop-release.yml@@ -287,9 +287,7 @@ jobs:with:node-version: "24"- - uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2- with:- install: false+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10- name: Get pnpm store directoryrun: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4@@ -554,9 +552,7 @@ jobs:with:node-version: "24"- - uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2- with:- install: false+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10- name: Get pnpm store directoryshell: bashrun: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"@@ -1058,9 +1054,7 @@ jobs:with:node-version: "24"- - uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2- with:- install: false+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10- name: Get pnpm store directoryrun: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4@@ -1402,9 +1396,7 @@ jobs:with:node-version: "24"- - uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2- with:- install: false+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10- name: Get pnpm store directoryrun: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"# `runner.arch` is part of the key: both Linux cells reportdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 48218dd4e..e9250248a 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -161,9 +161,7 @@ jobs:.github/scripts/probe-share-contract.mjs \test-support/fixtures/share-url-v1-v2.json- - uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2- with:- install: false+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10- name: Get pnpm store directoryshell: bashrun: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"