Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions script/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ if (Script.release && !Script.preview) {
await $`git push origin HEAD:${syncBranch} --no-verify`
}
}

if (Script.release) {
await $`gh release edit ${tag} --draft=false --repo ${process.env.GH_REPO}`
}
11 changes: 10 additions & 1 deletion script/version.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/usr/bin/env bun

import { Script } from "@opencode/script"
import { $ } from "bun"

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

if (!Script.preview || Script.channel === "beta") {
const tag = `v${Script.version}`
const repo = process.env.GH_REPO
// build-cli uploads the release archives to this draft, and script/publish.ts publishes it.
const existing = await $`gh release view ${tag} --repo ${repo} --json tagName`.quiet().nothrow()
if (existing.exitCode !== 0) {
const target = process.env.GITHUB_SHA ?? (await $`git rev-parse HEAD`.text()).trim()
await $`gh release create ${tag} --draft --target ${target} --title ${tag} --generate-notes --repo ${repo}`
}
output.push("release=true")
output.push(`tag=v${Script.version}`)
output.push(`tag=${tag}`)
}

output.push(`repo=${process.env.GH_REPO}`)
Expand Down
Loading