Skip to content

Commit 35884de

Browse files
committed
ci
1 parent 15dc33d commit 35884de

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

script/version.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
import { Script } from "@opencode-ai/script"
44
import { $ } from "bun"
5-
import { buildNotes, getLatestRelease } from "./changelog"
65

76
const output = [`version=${Script.version}`]
87

98
if (!Script.preview) {
10-
const previous = await getLatestRelease()
11-
const notes = await buildNotes(previous, "HEAD")
12-
const body = notes.join("\n") || "No notable changes"
9+
await $`opencode run --command changelog`.cwd(process.cwd())
10+
const file = `${process.cwd()}/UPCOMING_CHANGELOG.md`
11+
const body = await Bun.file(file)
12+
.text()
13+
.catch(() => "No notable changes")
1314
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}`
15+
const notesFile = `${dir}/opencode-release-notes.txt`
16+
await Bun.write(notesFile, body)
17+
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${notesFile}`
1718
const release = await $`gh release view v${Script.version} --json tagName,databaseId`.json()
1819
output.push(`release=${release.databaseId}`)
1920
output.push(`tag=${release.tagName}`)

0 commit comments

Comments
 (0)