f963465759
The version job ran `bunx changeset version` to consume .changeset/*.md files and update CHANGELOG.md, but the publish job (which commits and pushes) ran on a separate runner with a fresh checkout — discarding all changelog changes. This caused CHANGELOG.md to stay stuck at 7.2.1 despite 9 subsequent releases. Move changeset consumption into publish.ts so it runs on the same runner that commits. Extract release notes from the updated changelog and pass them to `gh release edit` so GitHub releases also get correct notes.
33 lines
1.2 KiB
TypeScript
Executable File
33 lines
1.2 KiB
TypeScript
Executable File
#!/usr/bin/env bun
|
|
|
|
import { Script } from "@opencode-ai/script"
|
|
import { $ } from "bun"
|
|
|
|
const output = [`version=${Script.version}`]
|
|
|
|
if (!Script.preview) {
|
|
// kilocode_change start - create draft release; changelog generation and
|
|
// release notes are handled by publish.ts on the same runner that commits.
|
|
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes ""`
|
|
// kilocode_change end
|
|
const release = await $`gh release view v${Script.version} --json tagName,databaseId`.json()
|
|
output.push(`release=${release.databaseId}`)
|
|
output.push(`tag=${release.tagName}`)
|
|
// kilocode_change start - handle both beta and rc preview channels
|
|
} else if (Script.channel === "beta" || Script.channel === "rc") {
|
|
await $`gh release create v${Script.version} -d --prerelease --title "v${Script.version}" --repo ${process.env.GH_REPO}`
|
|
const release =
|
|
await $`gh release view v${Script.version} --json tagName,databaseId --repo ${process.env.GH_REPO}`.json()
|
|
output.push(`release=${release.databaseId}`)
|
|
output.push(`tag=${release.tagName}`)
|
|
// kilocode_change end
|
|
}
|
|
|
|
output.push(`repo=${process.env.GH_REPO}`)
|
|
|
|
if (process.env.GITHUB_OUTPUT) {
|
|
await Bun.write(process.env.GITHUB_OUTPUT, output.join("\n"))
|
|
}
|
|
|
|
process.exit(0)
|