ci: ignore
This commit is contained in:
@@ -6,9 +6,6 @@ process.chdir(dir)
|
|||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
|
||||||
console.log("=== Generating JS SDK ===")
|
|
||||||
console.log()
|
|
||||||
|
|
||||||
import { createClient } from "@hey-api/openapi-ts"
|
import { createClient } from "@hey-api/openapi-ts"
|
||||||
|
|
||||||
await $`bun dev generate > ${dir}/openapi.json`.cwd(path.resolve(dir, "../../opencode"))
|
await $`bun dev generate > ${dir}/openapi.json`.cwd(path.resolve(dir, "../../opencode"))
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
||||||
|
console.log("=== publishing ===\n")
|
||||||
|
|
||||||
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
|
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
|
||||||
const version = snapshot
|
const version = snapshot
|
||||||
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
|
? `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")
|
throw new Error("OPENCODE_VERSION is required")
|
||||||
}
|
}
|
||||||
process.env["OPENCODE_VERSION"] = version
|
process.env["OPENCODE_VERSION"] = version
|
||||||
|
console.log("version:", version)
|
||||||
|
|
||||||
const pkgjsons = await Array.fromAsync(
|
const pkgjsons = await Array.fromAsync(
|
||||||
new Bun.Glob("**/package.json").scan({
|
new Bun.Glob("**/package.json").scan({
|
||||||
absolute: true,
|
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())
|
const tree = await $`git add . && git write-tree`.text().then((x) => x.trim())
|
||||||
for await (const file of new Bun.Glob("**/package.json").scan({
|
for (const file of pkgjsons) {
|
||||||
absolute: true,
|
|
||||||
})) {
|
|
||||||
let pkg = await Bun.file(file).text()
|
let pkg = await Bun.file(file).text()
|
||||||
pkg = pkg.replaceAll(/"version": "[^"]+"/g, `"version": "${version}"`)
|
pkg = pkg.replaceAll(/"version": "[^"]+"/g, `"version": "${version}"`)
|
||||||
|
console.log("updated:", file)
|
||||||
await Bun.file(file).write(pkg)
|
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`)
|
await import(`../packages/sdk/js/script/publish.ts`)
|
||||||
|
|
||||||
|
console.log("\n=== plugin ===\n")
|
||||||
await import(`../packages/plugin/script/publish.ts`)
|
await import(`../packages/plugin/script/publish.ts`)
|
||||||
// await import(`../packages/sdk/stainless/generate.ts`)
|
// await import(`../packages/sdk/stainless/generate.ts`)
|
||||||
|
|
||||||
@@ -43,9 +50,7 @@ if (snapshot) {
|
|||||||
await $`git push origin v${version} --no-verify`
|
await $`git push origin v${version} --no-verify`
|
||||||
await $`git checkout dev`
|
await $`git checkout dev`
|
||||||
await $`git branch -D snapshot-${version}`
|
await $`git branch -D snapshot-${version}`
|
||||||
for await (const file of new Bun.Glob("**/package.json").scan({
|
for (const file of pkgjsons) {
|
||||||
absolute: true,
|
await $`git checkout ${tree} ${file}`
|
||||||
})) {
|
|
||||||
$`await git checkout ${tree} ${file}`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user