diff --git a/packages/opencode/script/kilocode/npm-publish.ts b/packages/opencode/script/kilocode/npm-publish.ts index 8f07ed2e75..2744ff675e 100644 --- a/packages/opencode/script/kilocode/npm-publish.ts +++ b/packages/opencode/script/kilocode/npm-publish.ts @@ -3,10 +3,6 @@ export namespace NpmPublish { const base = 10_000 const jitter = 5_000 - export function aliases(channel: string) { - return channel === "latest" ? ["rc"] : [] - } - export async function retry(input: { name: string version: string diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index cfc99cacab..bd94c7c0e3 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -16,21 +16,18 @@ async function publish(dir: string, name: string, version: string) { // GitHub artifact downloads can drop the executable bit, and Docker uses the // unpacked dist binaries directly rather than the published tarball. if (process.platform !== "win32") await $`chmod -R 755 .`.cwd(dir) - // kilocode_change start - const exists = await published(name, version) - if (exists) { + if (await published(name, version)) { console.log(`already published ${name}@${version}`) + return } - if (!exists) { - await $`bun pm pack`.cwd(dir) - await NpmPublish.retry({ - name, - version, - run: () => $`npm publish *.tgz --access public --tag ${Script.channel} --provenance`.cwd(dir), - exists: () => published(name, version), - }) - } - for (const tag of NpmPublish.aliases(Script.channel)) await $`npm dist-tag add ${name}@${version} ${tag}` + await $`bun pm pack`.cwd(dir) + // kilocode_change start + await NpmPublish.retry({ + name, + version, + run: () => $`npm publish *.tgz --access public --tag ${Script.channel} --provenance`.cwd(dir), + exists: () => published(name, version), + }) // kilocode_change end } diff --git a/packages/opencode/test/kilocode/npm-publish.test.ts b/packages/opencode/test/kilocode/npm-publish.test.ts index 33318925ce..62e9434986 100644 --- a/packages/opencode/test/kilocode/npm-publish.test.ts +++ b/packages/opencode/test/kilocode/npm-publish.test.ts @@ -1,16 +1,6 @@ import { describe, expect, test } from "bun:test" import { NpmPublish } from "../../script/kilocode/npm-publish" -describe("npm publish aliases", () => { - test("promotes stable releases to the rc channel", () => { - expect(NpmPublish.aliases("latest")).toEqual(["rc"]) - }) - - test("does not promote prereleases", () => { - expect(NpmPublish.aliases("rc")).toEqual([]) - }) -}) - describe("npm publish retry", () => { test("returns after the first successful attempt", async () => { const calls = { run: 0, exists: 0, sleep: 0 }