Files
Catriel Müller 1eedad9213 Refactor publish workflow and environment variables (#261)
* feat: changelog generation

* refactor: rename all ENV variables to KILO prefix

* refactor: publish rework

* refactor: publish rework

* refactor: unify git commiter action

* refactor: add all kilobots to the team
2026-02-12 09:00:51 +01:00

22 lines
762 B
TypeScript
Executable File

#!/usr/bin/env bun
import { Script } from "@opencode-ai/script"
import { $ } from "bun"
const dir = new URL("..", import.meta.url).pathname
process.chdir(dir)
await $`bun tsc`
const pkg = await import("../package.json").then((m) => m.default)
const original = JSON.parse(JSON.stringify(pkg))
for (const [key, value] of Object.entries(pkg.exports)) {
const file = value.replace("./src/", "./dist/").replace(".ts", "")
// @ts-ignore
pkg.exports[key] = {
import: file + ".js",
types: file + ".d.ts",
}
}
await Bun.write("package.json", JSON.stringify(pkg, null, 2))
await $`bun pm pack && npm publish *.tgz --tag ${Script.channel} --access public --provenance` // kilocode_change
await Bun.write("package.json", JSON.stringify(original, null, 2))