pull/16402/merge
parent
15dc33d1a3
commit
35884defd8
|
|
@ -2,18 +2,19 @@
|
||||||
|
|
||||||
import { Script } from "@opencode-ai/script"
|
import { Script } from "@opencode-ai/script"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
import { buildNotes, getLatestRelease } from "./changelog"
|
|
||||||
|
|
||||||
const output = [`version=${Script.version}`]
|
const output = [`version=${Script.version}`]
|
||||||
|
|
||||||
if (!Script.preview) {
|
if (!Script.preview) {
|
||||||
const previous = await getLatestRelease()
|
await $`opencode run --command changelog`.cwd(process.cwd())
|
||||||
const notes = await buildNotes(previous, "HEAD")
|
const file = `${process.cwd()}/UPCOMING_CHANGELOG.md`
|
||||||
const body = notes.join("\n") || "No notable changes"
|
const body = await Bun.file(file)
|
||||||
|
.text()
|
||||||
|
.catch(() => "No notable changes")
|
||||||
const dir = process.env.RUNNER_TEMP ?? "/tmp"
|
const dir = process.env.RUNNER_TEMP ?? "/tmp"
|
||||||
const file = `${dir}/opencode-release-notes.txt`
|
const notesFile = `${dir}/opencode-release-notes.txt`
|
||||||
await Bun.write(file, body)
|
await Bun.write(notesFile, body)
|
||||||
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${file}`
|
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${notesFile}`
|
||||||
const release = await $`gh release view v${Script.version} --json tagName,databaseId`.json()
|
const release = await $`gh release view v${Script.version} --json tagName,databaseId`.json()
|
||||||
output.push(`release=${release.databaseId}`)
|
output.push(`release=${release.databaseId}`)
|
||||||
output.push(`tag=${release.tagName}`)
|
output.push(`tag=${release.tagName}`)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue