ci: ignore

This commit is contained in:
Dax Raad
2025-08-03 12:37:59 -04:00
parent 263b266476
commit d4bac5cdbd
2 changed files with 14 additions and 12 deletions

View File

@@ -6,9 +6,6 @@ process.chdir(dir)
import { $ } from "bun"
import path from "path"
console.log("=== Generating JS SDK ===")
console.log()
import { createClient } from "@hey-api/openapi-ts"
await $`bun dev generate > ${dir}/openapi.json`.cwd(path.resolve(dir, "../../opencode"))

View File

@@ -2,6 +2,8 @@
import { $ } from "bun"
console.log("=== publishing ===\n")
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
const version = snapshot
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
@@ -10,24 +12,29 @@ if (!version) {
throw new Error("OPENCODE_VERSION is required")
}
process.env["OPENCODE_VERSION"] = version
console.log("version:", version)
const pkgjsons = await Array.fromAsync(
new Bun.Glob("**/package.json").scan({
absolute: true,
}),
)
).then((arr) => arr.filter((x) => !x.includes("node_modules") && !x.includes("dist")))
const tree = await $`git add . && git write-tree`.text().then((x) => x.trim())
for await (const file of new Bun.Glob("**/package.json").scan({
absolute: true,
})) {
for (const file of pkgjsons) {
let pkg = await Bun.file(file).text()
pkg = pkg.replaceAll(/"version": "[^"]+"/g, `"version": "${version}"`)
console.log("updated:", file)
await Bun.file(file).write(pkg)
}
await import(`../packages/opencode/script/publish.ts`)
console.log("\n=== opencode ===\n")
// await import(`../packages/opencode/script/publish.ts`)
console.log("\n=== sdk ===\n")
await import(`../packages/sdk/js/script/publish.ts`)
console.log("\n=== plugin ===\n")
await import(`../packages/plugin/script/publish.ts`)
// await import(`../packages/sdk/stainless/generate.ts`)
@@ -43,9 +50,7 @@ if (snapshot) {
await $`git push origin v${version} --no-verify`
await $`git checkout dev`
await $`git branch -D snapshot-${version}`
for await (const file of new Bun.Glob("**/package.json").scan({
absolute: true,
})) {
$`await git checkout ${tree} ${file}`
for (const file of pkgjsons) {
await $`git checkout ${tree} ${file}`
}
}