Skip to content

Commit 462f34f

Browse files
sanchitrkclaude
andcommitted
fix(ci): bake the published version into bundles, skip changelog-only pushes
A bundle that imports its package.json inlined the repo version, so a canary or dev install reported the base version. The build now sees the version being published. A push that only changes CHANGELOG.md no longer publishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 763b062 commit 462f34f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/publish.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches: [canary, dev]
99
paths-ignore:
1010
- sites/www/**
11+
- CHANGELOG.md
1112
workflow_dispatch:
1213

1314
permissions:

‎scripts/publish.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,10 @@ for (const name of workspaceDependencies(manifest)) {
349349
console.error(` ${name}: ${version}`);
350350
}
351351

352-
console.error(`Building ${manifest.name}@${manifest.version} in ${packageDir}`);
352+
console.error(`Building ${manifest.name}@${publishVersion} in ${packageDir}`);
353353

354+
// A bundle that imports its package.json inlines the version, so build with the one being published.
355+
await writeFile(manifestPath, originalManifestText.replace(/"version": "[^"]*"/, `"version": "${publishVersion}"`));
354356
const buildExitCode = await run("pnpm", ["run", "build"], packageDir);
355357
await restoreFile(manifestPath, originalManifestText);
356358

0 commit comments

Comments
 (0)