summaryrefslogtreecommitdiffhomepage
path: root/script
diff options
context:
space:
mode:
authorDax <[email protected]>2026-01-29 13:17:55 -0500
committerGitHub <[email protected]>2026-01-29 13:17:55 -0500
commit9ed3b0742f3861c5cbb0974329b13a228dcfd1a7 (patch)
treeaaa85ad12d4a2edc82925361bdf29f9a0394cd81 /script
parentae9199e1014ca042262f53593167577a4e66f17c (diff)
downloadopencode-9ed3b0742f3861c5cbb0974329b13a228dcfd1a7.tar.gz
opencode-9ed3b0742f3861c5cbb0974329b13a228dcfd1a7.zip
ci (#11149)
Co-authored-by: opencode <[email protected]>
Diffstat (limited to 'script')
-rwxr-xr-xscript/publish-complete.ts14
-rwxr-xr-xscript/publish.ts (renamed from script/publish-start.ts)43
-rwxr-xr-xscript/version.ts17
3 files changed, 32 insertions, 42 deletions
diff --git a/script/publish-complete.ts b/script/publish-complete.ts
deleted file mode 100755
index a3bdceae0..000000000
--- a/script/publish-complete.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bun
-
-import { Script } from "@opencode-ai/script"
-import { $ } from "bun"
-
-if (!Script.preview) {
- await $`gh release edit v${Script.version} --draft=false`
-}
-
-await $`bun install`
-
-await $`gh release download --pattern "opencode-linux-*64.tar.gz" --pattern "opencode-darwin-*64.zip" -D dist`
-
-await import(`../packages/opencode/script/publish-registries.ts`)
diff --git a/script/publish-start.ts b/script/publish.ts
index 474e01a64..23a6e5c9d 100755
--- a/script/publish-start.ts
+++ b/script/publish.ts
@@ -32,16 +32,8 @@ Add highlights before publishing. Delete this section if no highlights.
`
-let notes: string[] = []
-
console.log("=== publishing ===\n")
-if (!Script.preview) {
- const previous = await getLatestRelease()
- notes = await buildNotes(previous, "HEAD")
- // notes.unshift(highlightsTemplate)
-}
-
const pkgjsons = await Array.fromAsync(
new Bun.Glob("**/package.json").scan({
absolute: true,
@@ -63,8 +55,22 @@ console.log("updated:", extensionToml)
await Bun.file(extensionToml).write(toml)
await $`bun install`
+await import(`../packages/sdk/js/script/build.ts`)
+
+if (Script.release) {
+ const previous = await getLatestRelease()
+ const notes = await buildNotes(previous, "HEAD")
+ // notes.unshift(highlightsTemplate)
+ await $`git commit -am "release: v${Script.version}"`
+ await $`git tag v${Script.version}`
+ await $`git fetch origin`
+ await $`git cherry-pick HEAD..origin/dev`.nothrow()
+ await $`git push origin HEAD --tags --no-verify --force-with-lease`
+ await new Promise((resolve) => setTimeout(resolve, 5_000))
+ await $`gh release edit v${Script.version} --draft=false --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"}`
+}
-console.log("\n=== opencode ===\n")
+console.log("\n=== cli ===\n")
await import(`../packages/opencode/script/publish.ts`)
console.log("\n=== sdk ===\n")
@@ -75,22 +81,3 @@ await import(`../packages/plugin/script/publish.ts`)
const dir = new URL("..", import.meta.url).pathname
process.chdir(dir)
-
-let output = `version=${Script.version}\n`
-
-if (!Script.preview) {
- await $`git commit -am "release: v${Script.version}"`
- await $`git tag v${Script.version}`
- await $`git fetch origin`
- await $`git cherry-pick HEAD..origin/dev`.nothrow()
- await $`git push origin HEAD --tags --no-verify --force-with-lease`
- await new Promise((resolve) => setTimeout(resolve, 5_000))
- await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz`
- const release = await $`gh release view v${Script.version} --json id,tagName`.json()
- output += `release=${release.id}\n`
- output += `tag=${release.tagName}\n`
-}
-
-if (process.env.GITHUB_OUTPUT) {
- await Bun.write(process.env.GITHUB_OUTPUT, output)
-}
diff --git a/script/version.ts b/script/version.ts
new file mode 100755
index 000000000..861417f75
--- /dev/null
+++ b/script/version.ts
@@ -0,0 +1,17 @@
+#!/usr/bin/env bun
+
+import { Script } from "@opencode-ai/script"
+import { $ } from "bun"
+
+let 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()
+ output.push(`release=${release.id}`)
+ output.push(`tag=${release.tagName}`)
+}
+
+if (process.env.GITHUB_OUTPUT) {
+ await Bun.write(process.env.GITHUB_OUTPUT, output.join("\n"))
+}