diff options
| author | Dax Raad <[email protected]> | 2026-01-30 01:15:24 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-01-30 01:15:24 -0500 |
| commit | d58661d4fb4be22f2188fb3619c2b8f75f5b40ac (patch) | |
| tree | b9c748942e5343cd0a207c46134c1b6dbc7bab3b /script | |
| parent | 09f4ef899632ea7179c08230a25d325feed8f5aa (diff) | |
| download | opencode-d58661d4fb4be22f2188fb3619c2b8f75f5b40ac.tar.gz opencode-d58661d4fb4be22f2188fb3619c2b8f75f5b40ac.zip | |
ci
Diffstat (limited to 'script')
| -rwxr-xr-x | script/changelog.ts | 19 | ||||
| -rwxr-xr-x | script/version.ts | 12 |
2 files changed, 19 insertions, 12 deletions
diff --git a/script/changelog.ts b/script/changelog.ts index 0c8d65ba1..0043cd3d6 100755 --- a/script/changelog.ts +++ b/script/changelog.ts @@ -1,7 +1,7 @@ #!/usr/bin/env bun import { $ } from "bun" -import { createOpencode } from "@opencode-ai/sdk" +import { createOpencode } from "@opencode-ai/sdk/v2" import { parseArgs } from "util" export const team = [ @@ -153,9 +153,9 @@ async function summarizeCommit(opencode: Awaited<ReturnType<typeof createOpencod console.log("summarizing commit:", message) const session = await opencode.client.session.create() const result = await opencode.client.session - .prompt({ - path: { id: session.data!.id }, - body: { + .prompt( + { + sessionID: session.data!.id, model: { providerID: "opencode", modelID: "claude-sonnet-4-5" }, tools: { "*": false, @@ -169,8 +169,10 @@ Commit: ${message}`, }, ], }, - signal: AbortSignal.timeout(120_000), - }) + { + signal: AbortSignal.timeout(120_000), + }, + ) .then((x) => x.data?.parts?.find((y) => y.type === "text")?.text ?? message) return result.trim() } @@ -238,7 +240,7 @@ export async function buildNotes(from: string, to: string) { console.log("generating changelog since " + from) - const opencode = await createOpencode({ port: 5044 }) + const opencode = await createOpencode({ port: 0 }) const notes: string[] = [] try { @@ -258,8 +260,9 @@ export async function buildNotes(from: string, to: string) { throw error } } finally { - opencode.server.close() + await opencode.server.close() } + console.log("changelog generation complete") const contributors = await getContributors(from, to) diff --git a/script/version.ts b/script/version.ts index 2c158d222..1b7eac5d9 100755 --- a/script/version.ts +++ b/script/version.ts @@ -7,12 +7,14 @@ import { buildNotes, getLatestRelease } from "./changelog" const output = [`version=${Script.version}`] if (!Script.preview) { - await $`gh release create v${Script.version} -d --title "v${Script.version}" ${Script.preview ? "--prerelease" : ""}` - const release = await $`gh release view v${Script.version} --json id,tagName`.json() - const previous = await getLatestRelease(Script.version) + const previous = await getLatestRelease() const notes = await buildNotes(previous, "HEAD") const body = notes.join("\n") || "No notable changes" - await $`gh release edit v${Script.version} --title "v${Script.version}" --notes ${body}` + const dir = process.env.RUNNER_TEMP ?? "/tmp" + const file = `${dir}/opencode-release-notes.txt` + await Bun.write(file, body) + await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${file}` + const release = await $`gh release view v${Script.version} --json id,tagName`.json() output.push(`release=${release.id}`) output.push(`tag=${release.tagName}`) } @@ -20,3 +22,5 @@ if (!Script.preview) { if (process.env.GITHUB_OUTPUT) { await Bun.write(process.env.GITHUB_OUTPUT, output.join("\n")) } + +process.exit(0) |
