Skip to content

Commit d58661d

Browse files
committed
ci
1 parent 09f4ef8 commit d58661d

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

bun.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/changelog.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bun
22

33
import { $ } from "bun"
4-
import { createOpencode } from "@opencode-ai/sdk"
4+
import { createOpencode } from "@opencode-ai/sdk/v2"
55
import { parseArgs } from "util"
66

77
export const team = [
@@ -153,9 +153,9 @@ async function summarizeCommit(opencode: Awaited<ReturnType<typeof createOpencod
153153
console.log("summarizing commit:", message)
154154
const session = await opencode.client.session.create()
155155
const result = await opencode.client.session
156-
.prompt({
157-
path: { id: session.data!.id },
158-
body: {
156+
.prompt(
157+
{
158+
sessionID: session.data!.id,
159159
model: { providerID: "opencode", modelID: "claude-sonnet-4-5" },
160160
tools: {
161161
"*": false,
@@ -169,8 +169,10 @@ Commit: ${message}`,
169169
},
170170
],
171171
},
172-
signal: AbortSignal.timeout(120_000),
173-
})
172+
{
173+
signal: AbortSignal.timeout(120_000),
174+
},
175+
)
174176
.then((x) => x.data?.parts?.find((y) => y.type === "text")?.text ?? message)
175177
return result.trim()
176178
}
@@ -238,7 +240,7 @@ export async function buildNotes(from: string, to: string) {
238240

239241
console.log("generating changelog since " + from)
240242

241-
const opencode = await createOpencode({ port: 5044 })
243+
const opencode = await createOpencode({ port: 0 })
242244
const notes: string[] = []
243245

244246
try {
@@ -258,8 +260,9 @@ export async function buildNotes(from: string, to: string) {
258260
throw error
259261
}
260262
} finally {
261-
opencode.server.close()
263+
await opencode.server.close()
262264
}
265+
console.log("changelog generation complete")
263266

264267
const contributors = await getContributors(from, to)
265268

script/version.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ import { buildNotes, getLatestRelease } from "./changelog"
77
const output = [`version=${Script.version}`]
88

99
if (!Script.preview) {
10-
await $`gh release create v${Script.version} -d --title "v${Script.version}" ${Script.preview ? "--prerelease" : ""}`
11-
const release = await $`gh release view v${Script.version} --json id,tagName`.json()
12-
const previous = await getLatestRelease(Script.version)
10+
const previous = await getLatestRelease()
1311
const notes = await buildNotes(previous, "HEAD")
1412
const body = notes.join("\n") || "No notable changes"
15-
await $`gh release edit v${Script.version} --title "v${Script.version}" --notes ${body}`
13+
const dir = process.env.RUNNER_TEMP ?? "/tmp"
14+
const file = `${dir}/opencode-release-notes.txt`
15+
await Bun.write(file, body)
16+
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${file}`
17+
const release = await $`gh release view v${Script.version} --json id,tagName`.json()
1618
output.push(`release=${release.id}`)
1719
output.push(`tag=${release.tagName}`)
1820
}
1921

2022
if (process.env.GITHUB_OUTPUT) {
2123
await Bun.write(process.env.GITHUB_OUTPUT, output.join("\n"))
2224
}
25+
26+
process.exit(0)

0 commit comments

Comments
 (0)