Skip to content

Commit ef2d415

Browse files
authored
fix(ci): skip already-published packages in publish script (CopilotKit#4979)
## Summary - publish-release.ts now checks npm for each package before publishing — skips versions already on the registry - Makes publish idempotent: safe to retry after partial failures (like the v1.57.4 situation where 1/15 published before crashing) - Removes the one-shot `publish-remaining` workflow (no longer needed) ## Test plan - [ ] Merge this PR - [ ] Dispatch `release / publish` with scope `monorepo` - [ ] Script skips `a2ui-renderer` (already at 1.57.4) and publishes the other 14
2 parents f0953c1 + 3df3179 commit ef2d415

2 files changed

Lines changed: 11 additions & 71 deletions

File tree

.github/workflows/publish-remaining.yml

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

scripts/release/publish-release.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,16 @@ async function main() {
153153
// Uses pnpm pack (workspace-aware) + npx npm@11 publish (OIDC-aware).
154154
// npm 11 uses GitHub Actions OIDC tokens for auth when id-token: write
155155
// is granted, eliminating the need for long-lived NPM_TOKEN secrets.
156+
// Skips packages already published at this version (idempotent retries).
156157
console.log("\nPublishing packages...");
158+
let skipped = 0;
157159
for (const p of getPackagesForScope(scope)) {
160+
const pubVersion = getPublishedVersion(p.name);
161+
if (pubVersion === version) {
162+
console.log(` Skipping ${p.name}@${version} (already published)`);
163+
skipped++;
164+
continue;
165+
}
158166
console.log(` Publishing ${p.name}@${version}...`);
159167
run("pnpm", ["pack"], { cwd: p.dir });
160168
const tarball = `${p.name.replace("@", "").replace("/", "-")}-${version}.tgz`;
@@ -173,6 +181,9 @@ async function main() {
173181
{ cwd: p.dir },
174182
);
175183
}
184+
if (skipped > 0) {
185+
console.log(`\n${skipped} package(s) skipped (already at ${version}).`);
186+
}
176187

177188
// Output version for downstream steps
178189
const outputPath = process.env.GITHUB_OUTPUT;

0 commit comments

Comments
 (0)