MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / publish

Function publish

apps/cli/src/build.ts:790–820  ·  view source on GitHub ↗
(channel: string)

Source from the content-addressed store, hash-verified

788};
789
790const publish = async (channel: string) => {
791 const meta = await readMetadata();
792
793 // Variants publish first so the wrapper's optionalDependencies resolve.
794 // All variants and the wrapper publish to the same npm package
795 // (`executor`) — variants under platform-tagged versions, wrapper under
796 // the channel tag. Single trusted-publishing config covers everything.
797 const platformDirs: string[] = [];
798 for (const entry of new Bun.Glob("executor-*/package.json").scanSync({ cwd: distDir })) {
799 platformDirs.push(join(distDir, dirname(entry)));
800 }
801 platformDirs.sort();
802
803 // Publish variants sequentially. They all PUT to the same npm package
804 // (`executor`), and the registry rejects concurrent packument updates with
805 // 409 Conflict ("Failed to save packument. A common cause is if you try to
806 // publish a new package before the previous package has been fully
807 // processed.") — that's exactly what happened on v1.4.14's first attempt,
808 // where 3 of 8 raced through and the rest 409'd. Serial is plenty fast
809 // (~5s per variant × 8 ≈ 40s).
810 console.log(`Publishing ${platformDirs.length} platform variant(s)...`);
811 for (const dir of platformDirs) {
812 const pkg = (await Bun.file(join(dir, "package.json")).json()) as { version: string };
813 const tag = variantTagFromVersion(pkg.version);
814 await publishPackedPackage(dir, tag);
815 }
816
817 const wrapperDir = join(distDir, meta.name);
818 console.log(`Publishing wrapper ${wrapperDir} under @${channel}...`);
819 await publishPackedPackage(wrapperDir, channel);
820};
821
822// ---------------------------------------------------------------------------
823// GitHub release assets

Callers 1

build.tsFile · 0.85

Calls 6

readMetadataFunction · 0.85
variantTagFromVersionFunction · 0.85
publishPackedPackageFunction · 0.85
pushMethod · 0.80
logMethod · 0.80
jsonMethod · 0.65

Tested by

no test coverage detected